From 1700b8b57c1fbb7cfa5406efcb3bf01304b80112 Mon Sep 17 00:00:00 2001 From: Developer Date: Wed, 3 Dec 2025 17:23:17 -0800 Subject: [PATCH] =?UTF-8?q?fix(mpc-system):=20=E4=BD=BF=E7=94=A8=20curl=20?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E5=81=A5=E5=BA=B7=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 wget --spider (HEAD 请求) 改为 curl -sf (GET 请求) - Gin 路由只响应 GET 请求,HEAD 请求返回 404 - 安装 curl 替代 wget 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- backend/mpc-system/services/account/Dockerfile | 5 +++-- backend/mpc-system/services/message-router/Dockerfile | 5 +++-- backend/mpc-system/services/server-party/Dockerfile | 5 +++-- backend/mpc-system/services/session-coordinator/Dockerfile | 6 +++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/backend/mpc-system/services/account/Dockerfile b/backend/mpc-system/services/account/Dockerfile index aff324d8..9706adab 100644 --- a/backend/mpc-system/services/account/Dockerfile +++ b/backend/mpc-system/services/account/Dockerfile @@ -23,7 +23,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ # Final stage FROM alpine:3.18 -RUN apk --no-cache add ca-certificates wget +RUN apk --no-cache add ca-certificates curl RUN adduser -D -s /bin/sh mpc COPY --from=builder /bin/account-service /bin/account-service @@ -32,7 +32,8 @@ USER mpc EXPOSE 50051 8080 +# Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD wget -q --spider http://localhost:8080/health || exit 1 + CMD curl -sf http://localhost:8080/health || exit 1 ENTRYPOINT ["/bin/account-service"] diff --git a/backend/mpc-system/services/message-router/Dockerfile b/backend/mpc-system/services/message-router/Dockerfile index d47a3682..597c9d19 100644 --- a/backend/mpc-system/services/message-router/Dockerfile +++ b/backend/mpc-system/services/message-router/Dockerfile @@ -23,7 +23,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ # Final stage FROM alpine:3.18 -RUN apk --no-cache add ca-certificates wget +RUN apk --no-cache add ca-certificates curl RUN adduser -D -s /bin/sh mpc COPY --from=builder /bin/message-router /bin/message-router @@ -32,7 +32,8 @@ USER mpc EXPOSE 50051 8080 +# Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD wget -q --spider http://localhost:8080/health || exit 1 + CMD curl -sf http://localhost:8080/health || exit 1 ENTRYPOINT ["/bin/message-router"] diff --git a/backend/mpc-system/services/server-party/Dockerfile b/backend/mpc-system/services/server-party/Dockerfile index 876ffb09..44439963 100644 --- a/backend/mpc-system/services/server-party/Dockerfile +++ b/backend/mpc-system/services/server-party/Dockerfile @@ -23,7 +23,7 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ # Final stage FROM alpine:3.18 -RUN apk --no-cache add ca-certificates wget +RUN apk --no-cache add ca-certificates curl RUN adduser -D -s /bin/sh mpc COPY --from=builder /bin/server-party /bin/server-party @@ -32,7 +32,8 @@ USER mpc EXPOSE 50051 8080 +# Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD wget -q --spider http://localhost:8080/health || exit 1 + CMD curl -sf http://localhost:8080/health || exit 1 ENTRYPOINT ["/bin/server-party"] diff --git a/backend/mpc-system/services/session-coordinator/Dockerfile b/backend/mpc-system/services/session-coordinator/Dockerfile index 478eca5a..6e15cce6 100644 --- a/backend/mpc-system/services/session-coordinator/Dockerfile +++ b/backend/mpc-system/services/session-coordinator/Dockerfile @@ -30,8 +30,8 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build \ # Final stage FROM alpine:3.18 -# Install ca-certificates for HTTPS -RUN apk --no-cache add ca-certificates wget +# Install ca-certificates and curl for HTTPS and health check +RUN apk --no-cache add ca-certificates curl # Create non-root user RUN adduser -D -s /bin/sh mpc @@ -47,7 +47,7 @@ EXPOSE 50051 8080 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD wget -q --spider http://localhost:8080/health || exit 1 + CMD curl -sf http://localhost:8080/health || exit 1 # Run the application ENTRYPOINT ["/bin/session-coordinator"]