feat(api): add /health endpoint with Docker healthchecks

Allow Docker to distinguish a running container from one actually
serving traffic by adding a /health endpoint that pings the database.
Returns 200 when healthy, 503 when the DB connection is lost.

Add HEALTHCHECK to Dockerfile and healthcheck config to the server
service in docker-compose.yml. Also add start_period to the existing
db healthcheck for consistency.
This commit is contained in:
Houmgaor
2026-02-23 20:34:20 +01:00
parent b96cd0904b
commit a72ac43f1d
5 changed files with 79 additions and 0 deletions

View File

@@ -25,4 +25,7 @@ COPY --from=builder /build/schemas/ ./schemas/
USER erupe
HEALTHCHECK --interval=10s --timeout=3s --start-period=15s --retries=3 \
CMD wget -qO- http://localhost:8080/health || exit 1
ENTRYPOINT ["./erupe-ce"]