fix(health): add /healthz route and tighten docker healthcheck
This commit is contained in:
@@ -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" },
|
||||||
|
});
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user