Add /api/health and harden Docker deploy script for API route rollout.

404 on /api/ai indicates stale container; deploy script now uses --no-cache, stops PM2/port conflicts, and verifies /api/health.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-10 22:42:28 +08:00
parent dba0245cb1
commit 38bbc7145a
4 changed files with 46 additions and 6 deletions
+10
View File
@@ -14,3 +14,13 @@ services:
NODE_ENV: production
PORT: "3130"
HOSTNAME: "0.0.0.0"
healthcheck:
test:
[
"CMD-SHELL",
"node -e \"fetch('http://127.0.0.1:3130/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))\"",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s