chore(docker): 为后端服务添加健康检查

This commit is contained in:
wangbo 2026-05-11 19:18:42 +08:00
parent f04bb5e4fc
commit f44a9a39e5

View File

@ -113,6 +113,12 @@ services:
# 日志大小设置,避免日志文件过大
env_file:
- .env
healthcheck:
test: ["CMD-SHELL", "node -e \"require('http').get('http://127.0.0.1:3001/health', (res) => { res.resume(); process.exit(res.statusCode === 200 ? 0 : 1); }).on('error', () => process.exit(1))\""]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
logging:
driver: "json-file"
options: