60 lines
1.4 KiB
YAML
60 lines
1.4 KiB
YAML
|
|
version: '3.8'
|
|||
|
|
|
|||
|
|
services:
|
|||
|
|
dongyun-web:
|
|||
|
|
build:
|
|||
|
|
context: .
|
|||
|
|
dockerfile: Dockerfile
|
|||
|
|
ports:
|
|||
|
|
- "80:80"
|
|||
|
|
- "443:443" # 如果使用HTTPS
|
|||
|
|
volumes:
|
|||
|
|
# 可选:挂载SSL证书
|
|||
|
|
# - ./ssl:/etc/nginx/ssl:ro
|
|||
|
|
# 可选:挂载日志目录
|
|||
|
|
- ./logs:/var/log/nginx
|
|||
|
|
environment:
|
|||
|
|
- NGINX_HOST=localhost
|
|||
|
|
- NGINX_PORT=80
|
|||
|
|
restart: unless-stopped
|
|||
|
|
healthcheck:
|
|||
|
|
test: ["CMD", "curl", "-f", "http://localhost/"]
|
|||
|
|
interval: 30s
|
|||
|
|
timeout: 10s
|
|||
|
|
retries: 3
|
|||
|
|
start_period: 40s
|
|||
|
|
networks:
|
|||
|
|
- dongyun-network
|
|||
|
|
|
|||
|
|
networks:
|
|||
|
|
dongyun-network:
|
|||
|
|
driver: bridge
|
|||
|
|
|
|||
|
|
# 可选:添加反向代理服务
|
|||
|
|
# 如果需要HTTPS和域名管理,可以取消注释以下配置
|
|||
|
|
#
|
|||
|
|
# services:
|
|||
|
|
# nginx-proxy:
|
|||
|
|
# image: jwilder/nginx-proxy
|
|||
|
|
# ports:
|
|||
|
|
# - "80:80"
|
|||
|
|
# - "443:443"
|
|||
|
|
# volumes:
|
|||
|
|
# - /var/run/docker.sock:/tmp/docker.sock:ro
|
|||
|
|
# - ./certs:/etc/nginx/certs
|
|||
|
|
# environment:
|
|||
|
|
# - DEFAULT_HOST=your-domain.com
|
|||
|
|
# networks:
|
|||
|
|
# - dongyun-network
|
|||
|
|
#
|
|||
|
|
# letsencrypt:
|
|||
|
|
# image: jrcs/letsencrypt-nginx-proxy-companion
|
|||
|
|
# volumes:
|
|||
|
|
# - /var/run/docker.sock:/var/run/docker.sock:ro
|
|||
|
|
# - ./certs:/etc/nginx/certs
|
|||
|
|
# - ./vhost.d:/etc/nginx/vhost.d
|
|||
|
|
# - ./html:/usr/share/nginx/html
|
|||
|
|
# environment:
|
|||
|
|
# - NGINX_PROXY_CONTAINER=nginx-proxy
|
|||
|
|
# networks:
|
|||
|
|
# - dongyun-network
|