From 595502b87a257869ad0b31dccc7b011c56ac56f3 Mon Sep 17 00:00:00 2001 From: Lembot Date: Fri, 12 Dec 2025 03:00:45 -0500 Subject: [PATCH] fix: use 127.0.0.1 in healthcheck to avoid IPv6 issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Alpine's wget resolves localhost to IPv6 [::1] first, but the Node.js server binds only to 0.0.0.0 (IPv4). This causes the healthcheck to fail with "Connection refused". 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- docker/ai-delegate/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/ai-delegate/Dockerfile b/docker/ai-delegate/Dockerfile index c070162..ec885b6 100644 --- a/docker/ai-delegate/Dockerfile +++ b/docker/ai-delegate/Dockerfile @@ -24,8 +24,8 @@ ENV PORT=3000 EXPOSE 3000 -# Health check +# Health check (use 127.0.0.1 instead of localhost to avoid IPv6 resolution issues in Alpine) HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1 + CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:3000/health || exit 1 CMD ["node", "server.js"] -- GitLab