fix(planting-service): 修复 CMD 路径并统一使用 curl
This commit is contained in:
parent
f3ac5d3718
commit
abe6d02a4c
|
|
@ -24,10 +24,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
|
||||
|
|
@ -47,8 +47,8 @@ COPY --from=builder /app/dist ./dist
|
|||
EXPOSE 3003
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3003/api/v1/health || exit 1
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s --retries=3 \
|
||||
CMD curl -f http://localhost:3003/api/v1/health || exit 1
|
||||
|
||||
# Start the application
|
||||
CMD ["node", "dist/src/main.js"]
|
||||
CMD ["node", "dist/main.js"]
|
||||
|
|
|
|||
Loading…
Reference in New Issue