From 6dd355187ada7b08dacfa634552ee5d1a6b6400b Mon Sep 17 00:00:00 2001 From: "593164063@qq.com" Date: Sat, 9 May 2026 13:20:54 +0800 Subject: [PATCH] fix(docker): use 127.0.0.1 in HEALTHCHECK for IPv4-only gateway localhost may resolve to ::1 while gateway listens on 127.0.0.1:18790, causing false unhealthy in Docker while manual checks succeed. --- docker/Dockerfile | 4 ++-- docker/Dockerfile.heavy | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 2e058b24c3..e378dfb1a1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -44,9 +44,9 @@ RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories RUN apk add --no-cache ca-certificates curl python3 tini tzdata -# Health check +# Health check (use 127.0.0.1: gateway listens on IPv4 only; "localhost" may resolve to ::1 and fail) HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD wget -q --spider http://localhost:18790/health || exit 1 + CMD wget -q --spider http://127.0.0.1:18790/health || exit 1 # Copy binary COPY --from=builder /src/build/picoclaw /usr/local/bin/picoclaw diff --git a/docker/Dockerfile.heavy b/docker/Dockerfile.heavy index cbc243e397..e777453250 100644 --- a/docker/Dockerfile.heavy +++ b/docker/Dockerfile.heavy @@ -41,9 +41,9 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \ ln -s /root/.local/bin/uvx /usr/local/bin/uvx && \ uv --version -# Health check +# Health check (127.0.0.1: gateway is IPv4-only; localhost may resolve to ::1) HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ - CMD wget -q --spider http://localhost:18790/health || exit 1 + CMD wget -q --spider http://127.0.0.1:18790/health || exit 1 # Copy binary COPY --from=builder /src/build/picoclaw /usr/local/bin/picoclaw