Docker-compose部署Nginx

vim docker-compose.yml

version: "3"
services:
  nginx:
    container_name: nginx
    image: nginx:latest
    restart: always
    privileged: true
    ports:
      - 80:80
    volumes:
      - /usr/local/docker/nginx/etc/nginx.conf:/etc/nginx/nginx.conf
      - /usr/local/docker/nginx/logs:/var/log/nginx
      - /usr/local/docker/nginx/html:/usr/share/nginx/html
      - /usr/local/docker/nginx/etc/conf.d:/etc/nginx/conf.d
~                                                               

docker-compose up -d
在这里插入图片描述
Docker-compose部署Nginx_第1张图片

你可能感兴趣的:(docker-compse,docker,nginx,容器)