fix(infra): frontend healthcheck on 127.0.0.1, not localhost #525
Reference in New Issue
Block a user
Delete Branch "fix/frontend-healthcheck-ipv4"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Nightly
Main Deploy staginghas been failing since the new alpine-based frontend production image landed (8b109349, 2026-05-10):The app itself is fine. The healthcheck is broken.
Root cause
Inside
node:20.19.0-alpine3.21,/etc/hostsresolveslocalhostonly to::1:SvelteKit's adapter-node binds to
0.0.0.0(IPv4 only) — no IPv6 listener. So the healthcheck'swget http://localhost:3000/loginconnects to::1:3000, getsConnection refused, exits 1, every 15s. After 10 retries the container is marked unhealthy anddocker compose up --waitfails the deploy.Verified on staging:
Fix
Switch the healthcheck URL to
127.0.0.1— bypasses/etc/hostsand matches what Node actually listens on. One-character change.Test plan
Main Deploy stagingcompletesdocker pson hetzner showsarchiv-staging-frontend-1as(healthy)docker inspect archiv-staging-frontend-1 --format '{{.State.Health.Status}}'returnshealthy🤖 Generated with Claude Code