version: '3' networks: local: name: local external: true services: ngx: container_name: ngx image: nginx:latest restart: always ports: - 80:80 - 443:443 networks: - local volumes: - ${DIR}/ngx/etc/nginx.conf:/etc/nginx/nginx.conf - ${DIR}/ngx/etc/conf.d:/etc/nginx/conf.d # 外层有公共参数定义 - ${DIR}/ngx/log:/var/log/nginx - /etc/localtime:/etc/localtime:ro environment: TZ: TERM: