the-tip-top-backend/Dockerfile

24 lines
478 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# É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
EXPOSE 4000
# Ajout dun healthcheck intelligent
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD wget -qO- http://localhost:4000/health || exit 1
# Lancement du serveur
CMD ["npm", "start"]