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