38 lines
1.2 KiB
YAML
38 lines
1.2 KiB
YAML
version: '3.8'
|
||
|
||
services:
|
||
# 数字档案管理系统前端服务
|
||
digital-archive-frontend:
|
||
image: ${IMAGE_NAME:-digital-archive-frontend}:${IMAGE_TAG:-latest}
|
||
container_name: ${CONTAINER_NAME:-digital-archive-frontend}
|
||
ports:
|
||
- "${HOST_PORT:-80}:80"
|
||
networks:
|
||
- ${NETWORK_NAME:-proxy}
|
||
restart: ${RESTART_POLICY:-unless-stopped}
|
||
environment:
|
||
- NGINX_HOST=${NGINX_HOST:-localhost}
|
||
- NGINX_PORT=80
|
||
volumes:
|
||
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||
# - ./ssl:/etc/nginx/ssl:ro # 如果需要SSL证书,取消注释并配置证书文件
|
||
healthcheck:
|
||
test: ["CMD", "curl", "-f", "http://localhost/"]
|
||
interval: 30s
|
||
timeout: 10s
|
||
retries: 3
|
||
start_period: 40s
|
||
labels:
|
||
- "traefik.enable=true"
|
||
- "traefik.http.routers.${CONTAINER_NAME:-digital-archive-frontend}.rule=Host(`${DOMAIN_NAME:-localhost}`)"
|
||
- "traefik.http.routers.${CONTAINER_NAME:-digital-archive-frontend}.entrypoints=web"
|
||
logging:
|
||
driver: "json-file"
|
||
options:
|
||
max-size: "10m"
|
||
max-file: "3"
|
||
|
||
networks:
|
||
proxy:
|
||
external: ${EXTERNAL_NETWORK:-true}
|
||
name: ${NETWORK_NAME:-proxy} |