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