53 lines
1.2 KiB
YAML
53 lines
1.2 KiB
YAML
# 生产环境覆盖配置(Issue #91)
|
|
# 用法:docker compose -f docker-compose.yml -f deploy/production/docker-compose.override.yml up -d
|
|
services:
|
|
app:
|
|
image: ${REGISTRY:-registry.xayunmei.local}/water-management-system:${IMAGE_TAG:-latest}
|
|
restart: always
|
|
read_only: true
|
|
user: "10001:10001"
|
|
tmpfs:
|
|
- /tmp
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "2.0"
|
|
memory: 2G
|
|
reservations:
|
|
memory: 512M
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: "50m"
|
|
max-file: "5"
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8000/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
ports:
|
|
- "127.0.0.1:8000:8000" # 仅绑定回环,由 Nginx 反向代理对外
|
|
environment:
|
|
- TZ=Asia/Shanghai
|
|
- APP_ENV=production
|
|
|
|
postgres:
|
|
restart: always
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
logging:
|
|
driver: json-file
|
|
options: { max-size: "20m", max-file: "3" }
|
|
|
|
nginx:
|
|
restart: always
|
|
ports:
|
|
- "443:443"
|
|
- "80:80"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./certs:/etc/nginx/certs:ro
|
|
|
|
volumes:
|
|
pgdata:
|