diff --git a/Dockerfile b/Dockerfile index 37f5084f..df76c67f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,22 @@ -# Étape 1 : Build minimal Node.js backend FROM node:18-alpine WORKDIR /app -# Copie des dépendances COPY package*.json ./ - -# Installation sans dépendances dev RUN npm ci --omit=dev -# Copie du code source COPY . . -# Exposition du port d’écoute +# 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 -# Ajout d’un healthcheck intelligent +# Healthcheck plus robuste HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \ - CMD wget -qO- http://localhost:4000/health || exit 1 + CMD curl -f http://localhost:4000/health || exit 1 -# Lancement du serveur CMD ["npm", "start"]