Deploy: API container and Caddy upstream probe /api/ready (Postgres-aware) instead of the I/O-free /api/health
2 changed files +2 −2
modified
deploy/docker/Dockerfile.api
+1 −1
@@ -47,6 +47,6 @@ RUN ln -s /usr/local/lib/node_modules/tsx /app/node_modules/tsx | ||
| 47 | 47 | USER node |
| 48 | 48 | EXPOSE 8311 |
| 49 | 49 | HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \ |
| 50 | − CMD ["node", "-e", "fetch('http://127.0.0.1:'+(process.env.API_PORT||8311)+'/api/health').then(r=>process.exit(r.ok?0:1),()=>process.exit(1))"] | |
| 50 | + CMD ["node", "-e", "fetch('http://127.0.0.1:'+(process.env.API_PORT||8311)+'/api/ready').then(r=>process.exit(r.ok?0:1),()=>process.exit(1))"] | |
| 51 | 51 | ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/dci-entrypoint"] |
| 52 | 52 | CMD ["api"] |
modified
deploy/edge/Caddyfile
+1 −1
@@ -35,7 +35,7 @@ | ||
| 35 | 35 | @metrics path /api/metrics |
| 36 | 36 | respond @metrics 404 |
| 37 | 37 | reverse_proxy api:8311 { |
| 38 | − health_uri /api/health | |
| 38 | + health_uri /api/ready | |
| 39 | 39 | health_interval 15s |
| 40 | 40 | fail_duration 10s |
| 41 | 41 | lb_try_duration 5s |
| 42 | 42 | |