the-tip-top-backend/Dockerfile

23 lines
454 B
Docker

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
# Nettoyer le .env pour ne pas écraser les variables Docker (facultatif mais recommandé)
# RUN rm -f .env
# Installer curl pour le healthcheck
RUN apk add --no-cache curl
EXPOSE 4000
# Healthcheck plus robuste
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD curl -f http://localhost:4000/health || exit 1
CMD ["npm", "start"]