the-tip-top-backend/Dockerfile
2025-11-04 00:11:07 +01:00

21 lines
438 B
Docker

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
EXPOSE 4000
# 🕓 Attente de la DB avant le démarrage
CMD sh -c "echo '⏳ Attente de PostgreSQL...' && sleep 10 && npm start"
# ✅ Installe curl pour le healthcheck
RUN apk add --no-cache curl
# 🩺 Healthcheck plus fiable avec curl
HEALTHCHECK --interval=10s --timeout=3s --retries=5 \
CMD curl -f http://localhost:4000/health || exit 1