From 24058bcb7720db4612277ba9e1f3165870bbad66 Mon Sep 17 00:00:00 2001 From: Hendrik Date: Fri, 17 Apr 2026 16:47:48 +0200 Subject: [PATCH] fix(docker): healthcheck uses 127.0.0.1, not localhost In the alpine runtime 'localhost' resolves to ::1 (IPv6) first. The SvelteKit Node adapter binds to 0.0.0.0 which is IPv4-only, so wget to 'localhost:3000' fails with 'Connection refused'. Traefik then filters the container as unhealthy and no router is registered. Using 127.0.0.1 makes the probe deterministically hit the bound IPv4 socket. Co-Authored-By: Claude Opus 4.7 (1M context) --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 04e5b18..49f5d92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,6 @@ VOLUME ["/data"] EXPOSE 3000 HEALTHCHECK --interval=15s --timeout=5s --retries=3 --start-period=20s --start-interval=2s \ - CMD wget -qO- http://localhost:3000/api/health > /dev/null || exit 1 + CMD wget -qO- http://127.0.0.1:3000/api/health > /dev/null || exit 1 CMD ["node", "build/index.js"]