docker-compose部署nginx

version: '3'
services:
  nginx:
    container_name: nginx
    image: nginx
    restart: always
    ports:
      - 80:80
    privileged: true
    volumes:
      - ./conf/proxy.conf:/etc/nginx/proxy.conf
      - ./conf/nginx.conf:/etc/nginx/nginx.conf
      - ./conf/conf.d/:/etc/nginx/conf.d/
      - ./html/:/usr/share/nginx/html/
      - ./logs/:/var/log/nginx/
    networks:
      - myweb

   deploy:
       replicas: 2
       resources:
         limits:
           cpus: '2'
           memory: 4G

networks:

  myweb:
    driver: bridge

 # 启动

docker-compose --compatibility up -d

 

posted @ 2020-01-26 15:50  Ray_chen  阅读(5552)  评论(1编辑  收藏  举报