From d88755d0d6633ce42f358efda1e127ce5507c9b6 Mon Sep 17 00:00:00 2001 From: Sisyphus Date: Wed, 19 Aug 2026 20:06:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(docker):=20=E5=89=8D=E7=AB=AF=20HEALTHCHECK?= =?UTF-8?q?=20=E6=94=B9=E7=94=A8=20127.0.0.1=EF=BC=8Cnginx=20=E4=BB=85?= =?UTF-8?q?=E7=9B=91=E5=90=AC=20IPv4=20=E5=AF=BC=E8=87=B4=20localhost(::1)?= =?UTF-8?q?=20=E8=BF=9E=E6=8E=A5=E8=A2=AB=E6=8B=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- perler-lab/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/perler-lab/Dockerfile b/perler-lab/Dockerfile index 34fed7c..b7a6471 100644 --- a/perler-lab/Dockerfile +++ b/perler-lab/Dockerfile @@ -41,8 +41,9 @@ COPY nginx.conf /etc/nginx/conf.d/default.conf # 复制构建产物(dist/ 含 index.html + assets/)到 nginx 根目录 COPY --from=build /app/dist /usr/share/nginx/html -# 健康检查 +# 健康检查——nginx 仅监听 IPv4 (0.0.0.0:80),必须用 127.0.0.1 而非 localhost +# (localhost 会解析到 ::1 IPv6,导致 wget 连接被拒) HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=10s \ - CMD wget -qO- http://localhost:80/healthz || exit 1 + CMD wget -qO- http://127.0.0.1:80/healthz || exit 1 EXPOSE 80