refactor: 将所有服务的健康检查从 wget 改为 curl

curl 相比 wget 的优势:
- 更轻量 (二进制文件更小)
- 更常用 (标准 HTTP 工具)
- 语法更简洁 (curl -f vs wget -q --spider)
- 退出码更可靠 (-f 参数在 HTTP 错误时返回非 0)

修改的服务:
- identity-service
- wallet-service
- mpc-service
- reward-service
- leaderboard-service
- reporting-service

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Developer 2025-12-02 09:19:35 -08:00
parent 5870614838
commit afdaa888ec
6 changed files with 18 additions and 18 deletions

View File

@ -35,10 +35,10 @@ FROM node:20-slim
WORKDIR /app
# Install OpenSSL and wget for health checks
# Install OpenSSL and curl for health checks
RUN apt-get update && apt-get install -y --no-install-recommends \
openssl \
wget \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install production dependencies only
@ -66,7 +66,7 @@ EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD wget -q --spider http://localhost:3000/api/v1/health || exit 1
CMD curl -f http://localhost:3000/api/v1/health || exit 1
# Start service
CMD ["node", "dist/src/main.js"]

View File

@ -38,10 +38,10 @@ FROM node:20-slim AS production
WORKDIR /app
# Install OpenSSL and wget for health checks
# Install OpenSSL and curl for health checks
RUN apt-get update && apt-get install -y --no-install-recommends \
openssl \
wget \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy package files and install production dependencies
@ -69,7 +69,7 @@ EXPOSE 3007
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD wget -q --spider http://localhost:3007/api/health || exit 1
CMD curl -f http://localhost:3007/api/health || exit 1
# Start the application
CMD ["node", "dist/src/main.js"]

View File

@ -38,10 +38,10 @@ FROM node:20-slim
WORKDIR /app
# Install OpenSSL and wget for health checks
# Install OpenSSL and curl for health checks
RUN apt-get update && apt-get install -y --no-install-recommends \
openssl \
wget \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install production dependencies only
@ -70,7 +70,7 @@ EXPOSE 3006
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD wget -q --spider http://localhost:3006/api/v1/health || exit 1
CMD curl -f http://localhost:3006/api/v1/health || exit 1
# Start service
CMD ["node", "dist/main.js"]

View File

@ -40,10 +40,10 @@ FROM node:20-slim
WORKDIR /app
# Install OpenSSL and wget for health checks
# Install OpenSSL and curl for health checks
RUN apt-get update && apt-get install -y --no-install-recommends \
openssl \
wget \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install production dependencies only
@ -71,7 +71,7 @@ EXPOSE 3008
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD wget -q --spider http://localhost:3008/api/v1/health || exit 1
CMD curl -f http://localhost:3008/api/v1/health || exit 1
# Start service
CMD ["node", "dist/src/main.js"]

View File

@ -38,10 +38,10 @@ FROM node:20-slim
WORKDIR /app
# Install OpenSSL and wget for health checks
# Install OpenSSL and curl for health checks
RUN apt-get update && apt-get install -y --no-install-recommends \
openssl \
wget \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install production dependencies only
@ -69,7 +69,7 @@ EXPOSE 3005
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD wget -q --spider http://localhost:3005/health || exit 1
CMD curl -f http://localhost:3005/health || exit 1
# Start service
CMD ["node", "dist/src/main.js"]

View File

@ -35,10 +35,10 @@ FROM node:20-slim
WORKDIR /app
# Install OpenSSL and wget for health checks
# Install OpenSSL and curl for health checks
RUN apt-get update && apt-get install -y --no-install-recommends \
openssl \
wget \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install production dependencies only
@ -64,7 +64,7 @@ EXPOSE 3001
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
CMD wget -q --spider http://localhost:3001/api/v1/health || exit 1
CMD curl -f http://localhost:3001/api/v1/health || exit 1
# Start service
CMD ["node", "dist/main.js"]