From 38320360a307ba25ffe3d8628e295d2377e7d52d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 8 May 2026 17:34:04 +0200 Subject: [PATCH] fix(deploy): healthcheck uses 127.0.0.1 + image pinned to :1.4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause of today's production outage: the docker-compose healthcheck used `wget --spider http://localhost:3000/api/version`. Inside Alpine containers, busybox-wget resolves `localhost` to IPv6 `::1` first. Next.js standalone (server.js) listens on IPv4 `0.0.0.0:3000` only — `::1` is not bound, so wget gets ECONNREFUSED. Docker marks the container unhealthy after 3 retries; Traefik takes the upstream out of rotation; Cloudflare returns 503 "no available server" because there's no healthy origin behind the route. Confirmed via SSH on apps-01: $ docker exec wget -O- http://localhost:3000/api/version Connecting to localhost:3000 ([::1]:3000) wget: can't connect to remote host: Connection refused $ netstat -tlnp tcp 0.0.0.0:3000 LISTEN 1/next-server (IPv4 only, as expected) Switching the URL to `http://127.0.0.1:3000/api/version` forces IPv4 and matches the Dockerfile's own HEALTHCHECK directive (which already used 127.0.0.1). Same fix shape for self-hosters: their `wget` will do the same thing on Alpine. This explains why today's deploys looked broken even after rolling back to v1.4.0 source and even after pinning to :1.3.3. The image contents were fine; the healthcheck path was always going to fail on this Alpine + Next.js combo. Why it worked yesterday: the previous deploy chain happened to skip the new healthcheck override in the compose file (the Dockerfile-level HEALTHCHECK uses 127.0.0.1 and was authoritative). Today's compose-level override flipped that. Image pinned back to `:1.4.1` (the multi-arch GHCR build that landed this afternoon — both `1.4.1` and `1.4.0` are healthy images, the healthcheck is what was sick). Co-Authored-By: Marc-André Bombeck --- docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 628bb7781..2ad7d68fd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: # to the last release that's verifiably running on self-host installs to # rule out runtime / Docker-network issues. No `build:` block on purpose: # we want Coolify to PULL the prebuilt image, not build from source. - image: ghcr.io/mbombeck/healthlog:1.3.3 + image: ghcr.io/mbombeck/healthlog:1.4.1 container_name: healthlog-app ports: - "3000:3000" @@ -41,7 +41,7 @@ services: test: [ "CMD-SHELL", - "wget --no-verbose --tries=1 --spider http://localhost:3000/api/version || exit 1", + "wget --no-verbose --tries=1 --spider http://127.0.0.1:3000/api/version || exit 1", ] interval: 30s timeout: 5s