feat(ops): add database readiness probe

This commit is contained in:
cesnimda
2026-08-31 11:54:36 +02:00
parent 2f146f743c
commit b9e703ee7c
6 changed files with 56 additions and 2 deletions
+6 -2
View File
@@ -305,9 +305,13 @@ than merely "running".
- **Backend:** `curl -fsS http://127.0.0.1:8080/health`. Anonymous, and deliberately **does not touch
the database** — a health check that queried MariaDB would restart a healthy backend whenever the
database blipped. `start_period` is 90s to cover first-boot schema reconciliation.
- **API/database readiness:** `curl -fsS https://<host>/ready`. This checks that the API can reach its
configured database and returns only `ready` or `unavailable`; detailed diagnostics remain admin-only.
Deployment validation requires this probe, while Docker restart policy continues to use liveness.
- **Frontend:** `wget` against nginx on port 80.
- `frontend` waits for `backend` to be *healthy*, not merely started, because nginx proxies `/api` to
it and refuses to start if the upstream cannot be resolved.
A backend that cannot reach its database exits and is reported `unhealthy`, so a broken deploy does not
present as a running stack.
A backend that cannot reach its database during startup exits and is reported `unhealthy`. A dependency
failure after startup leaves the process alive but makes `/ready` return 503, so deployment validation
cannot mistake a live-but-unready stack for a successful release.