You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

docker-compose.yml 837 B

12345678910111213141516171819202122
  1. version: "3.0"
  2. services:
  3. ngnix: #服务名称,名称可自定义
  4. container_name: nginx #容器名称,可自定义
  5. image: nginx:latest # 镜像名称
  6. restart: always
  7. ports: # 容器和服务器对应的端口映射,每次新增一个站点之后一定要在这里把对应的端口映射加上,不然肯定会404
  8. - "80:80"
  9. - "443:443"
  10. privileged: true
  11. volumes: #指定挂载目录
  12. - /data/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
  13. - /data/nginx/html/:/usr/share/nginx/html/
  14. - /data/nginx/logs/:/var/log/nginx/
  15. - /data/nginx/conf.d/:/etc/nginx/conf.d
  16. - /data/nginx/cert/:/home
  17. networks:
  18. - nginx
  19. networks:
  20. nginx:
  21. external: true