Fix: install curl for healthcheck, wget uses IPv6 on alpine

This commit is contained in:
Vivek 2026-05-31 06:49:14 +00:00
parent 527fb237e9
commit 6cbf8448c1

View file

@ -1,5 +1,7 @@
FROM node:22-alpine
RUN apk add --no-cache curl
WORKDIR /app
COPY webapp/package.json webapp/package-lock.json ./
@ -11,7 +13,7 @@ COPY webapp/.env ./.env
ENV NODE_ENV=production
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s \
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:3000/health || exit 1
HEALTHCHECK --interval=10s --timeout=3s --start-period=10s --retries=3 \
CMD curl -f http://127.0.0.1:3000/health || exit 1
CMD ["node", "src/server.js"]