fix(referral-service): 统一使用 curl 进行健康检查

This commit is contained in:
Developer 2025-12-02 10:39:36 -08:00
parent b5d097214b
commit f1b6370aae
2 changed files with 4 additions and 4 deletions

View File

@ -270,7 +270,7 @@ services:
kafka: kafka:
condition: service_started condition: service_started
healthcheck: healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3004/health"] test: ["CMD", "curl", "-f", "http://localhost:3004/health"]
interval: 30s interval: 30s
timeout: 3s timeout: 3s
retries: 3 retries: 3

View File

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