fix(docker): healthcheck uses 127.0.0.1, not localhost
All checks were successful
Build & Publish Docker Image / build-and-push (push) Successful in 54s

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) <noreply@anthropic.com>
This commit is contained in:
2026-04-17 16:47:48 +02:00
parent ec902049c1
commit 24058bcb77

View File

@@ -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"]