version: "3.8" services: nginx: image: nginx:alpine container_name: main-nginx restart: always ports: - "${NGINX_HTTP_PORT:-8080}:80" - "${NGINX_HTTPS_PORT:-8443}:443" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./nginx/conf.d:/etc/nginx/conf.d:ro - ./nginx/ssl:/etc/nginx/ssl:ro - ./nginx/logs:/var/log/nginx networks: - app-network extra_hosts: - "host.docker.internal:host-gateway" depends_on: - resume-web - miniapp-web - resume-api - miniapp-api env_file: - .env # 示例服务 - 个人简历网站 resume-web: image: nginx:alpine container_name: resume-web restart: always volumes: - ./services/resume-web/html:/usr/share/nginx/html:ro - ./services/resume-web/nginx.conf:/etc/nginx/conf.d/default.conf networks: - app-network expose: - "80" env_file: - .env # 示例服务 - 小程序网站 miniapp-web: image: nginx:alpine container_name: miniapp-web restart: always volumes: - ./services/miniapp-web/html:/usr/share/nginx/html:ro - ./services/miniapp-web/nginx.conf:/etc/nginx/conf.d/default.conf networks: - app-network expose: - "80" env_file: - .env # 示例服务 - 个人简历后台 resume-api: image: nginx:alpine container_name: resume-api restart: always volumes: - ./services/resume-api/nginx.conf:/etc/nginx/conf.d/default.conf networks: - app-network expose: - "80" env_file: - .env # 示例服务 - 小程序后台 miniapp-api: image: nginx:alpine container_name: miniapp-api restart: always volumes: - ./services/miniapp-api/nginx.conf:/etc/nginx/conf.d/default.conf networks: - app-network expose: - "80" env_file: - .env networks: app-network: driver: bridge name: aliyun-app-network