fix(health): add /healthz route and tighten docker healthcheck

This commit is contained in:
Gerhard Scheikl
2026-05-08 22:42:09 +02:00
parent 64dbdcbc6f
commit 02a93b502b
3 changed files with 10 additions and 2 deletions
+8
View File
@@ -0,0 +1,8 @@
// Lightweight unauthenticated health check used by Docker/Caddy.
// Returns 200 with a tiny JSON body. Do NOT touch the database here:
// the goal is only to confirm the Node process is serving HTTP.
export const loader = () =>
new Response(JSON.stringify({ ok: true }), {
status: 200,
headers: { "content-type": "application/json" },
});
+1 -1
View File
@@ -16,7 +16,7 @@ services:
volumes: volumes:
- /docker/linumiq-invoice/dev/data:/data - /docker/linumiq-invoice/dev/data:/data
healthcheck: healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3000/healthz", "||", "exit", "0"] test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3000/healthz"]
interval: 30s interval: 30s
timeout: 5s timeout: 5s
retries: 3 retries: 3
+1 -1
View File
@@ -16,7 +16,7 @@ services:
volumes: volumes:
- /docker/linumiq-invoice/prod/data:/data - /docker/linumiq-invoice/prod/data:/data
healthcheck: healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3000/healthz", "||", "exit", "0"] test: ["CMD", "wget", "-qO-", "http://127.0.0.1:3000/healthz"]
interval: 30s interval: 30s
timeout: 5s timeout: 5s
retries: 3 retries: 3