[DevOps] Add /health endpoint and Docker HEALTHCHECK

- src/routes/health/+server.ts: lightweight health endpoint returning 200 OK
- Dockerfile: HEALTHCHECK hitting /health every 30s, 5s timeout, 10s start period
  Enables Docker/Nginx zero-downtime routing and auto-recovery.
This commit is contained in:
Scott Idem
2026-03-10 11:29:02 -04:00
parent 01316789c6
commit d4f63138ad
2 changed files with 23 additions and 0 deletions

View File

@@ -43,4 +43,8 @@ COPY --from=builder /app/.env.production .env
# SvelteKit (via adapter-node) defaults to port 3000.
EXPOSE 3000
# Healthcheck to verify the app is running
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD node -e "fetch('http://localhost:3000/health').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"
CMD ["node", "index.js"]