From 02a93b502b73fe4716402c14f9266413469db0c1 Mon Sep 17 00:00:00 2001 From: Gerhard Scheikl Date: Fri, 8 May 2026 22:42:09 +0200 Subject: [PATCH] fix(health): add /healthz route and tighten docker healthcheck --- app/routes/healthz.tsx | 8 ++++++++ deploy/docker-compose.dev.yml | 2 +- deploy/docker-compose.prod.yml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 app/routes/healthz.tsx diff --git a/app/routes/healthz.tsx b/app/routes/healthz.tsx new file mode 100644 index 0000000..db7386f --- /dev/null +++ b/app/routes/healthz.tsx @@ -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" }, + }); diff --git a/deploy/docker-compose.dev.yml b/deploy/docker-compose.dev.yml index eb4997c..2a6cd50 100644 --- a/deploy/docker-compose.dev.yml +++ b/deploy/docker-compose.dev.yml @@ -16,7 +16,7 @@ services: volumes: - /docker/linumiq-invoice/dev/data:/data 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 timeout: 5s retries: 3 diff --git a/deploy/docker-compose.prod.yml b/deploy/docker-compose.prod.yml index 07ec1fc..3ce5525 100644 --- a/deploy/docker-compose.prod.yml +++ b/deploy/docker-compose.prod.yml @@ -16,7 +16,7 @@ services: volumes: - /docker/linumiq-invoice/prod/data:/data 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 timeout: 5s retries: 3