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
+11
View File
@@ -57,6 +57,17 @@ test.beforeEach(async ({ page }) => {
await page.addInitScript(() => window.localStorage.setItem("uiLanguage", "en"));
});
test("API liveness and database readiness are separate public probes", async ({ request }) => {
const origin = apiUrl.replace(/\/api$/, "");
const liveness = await request.get(`${origin}/health`);
const readiness = await request.get(`${origin}/ready`);
expect(liveness.status()).toBe(200);
expect(await liveness.json()).toMatchObject({ status: "ok" });
expect(readiness.status()).toBe(200);
expect(await readiness.json()).toEqual({ status: "ready" });
});
test("public plans stay honest, responsive and keyboard accessible", async ({ page }) => {
for (const scheme of ["light", "dark"] as const) {
await page.addInitScript((value) => window.localStorage.setItem("jobtracker.themeMode", value), scheme);
+10
View File
@@ -41,6 +41,16 @@ server {
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
}
location = /ready {
proxy_pass http://backend-web:8080/ready;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $http_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
}
location /api/ {
proxy_pass http://backend-web:8080;
proxy_http_version 1.1;