vi docker-compose.yml
version: '3'
services:
nginx:
container_name: nginx
image: nginx
restart: always
ports:
- 80:80
privileged: true
environment:
- TZ=Asia/Shanghai
volumes:
- /opt/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- /opt/nginx/dist:/opt/dist
- /opt/nginx/logs/:/var/log/nginx/
networks:
- myweb
deploy:
resources:
limits:
cpus: '0.80'
memory: 500M
reservations:
memory: 20M
networks:
myweb:
driver: bridge
docker-compose up -d
docker-compose down
nginx: download
http://nginx.org/en/download.html