feat: 支持本地与生产环境分离配置

- 新增 .gitignore 忽略敏感配置文件
- 新增 .env.local 本地开发环境配置
- 新增 .env.production 生产环境配置
- 新增 docker-compose.prod.yml 生产环境覆盖配置
- 更新 docker-compose.yml 使用 env_file 方式读取配置

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
lzh
2026-01-22 16:15:59 +08:00
parent 5de6cfc9de
commit 9f1feeb216
4 changed files with 116 additions and 12 deletions

26
docker-compose.prod.yml Normal file
View File

@@ -0,0 +1,26 @@
# 生产环境 Docker Compose 配置
# 使用方式: docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
services:
vitals:
env_file:
- .env.production
environment:
# 生产环境标识
- ENVIRONMENT=production
restart: always
# 生产环境日志配置
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# 资源限制(可选)
deploy:
resources:
limits:
cpus: '1'
memory: 512M
reservations:
cpus: '0.25'
memory: 128M