34 lines
682 B
Docker
34 lines
682 B
Docker
# ===========================
|
|
# Build stage
|
|
# ===========================
|
|
FROM node:20-bullseye AS builder
|
|
|
|
# Définir le répertoire de travail
|
|
WORKDIR /app
|
|
|
|
# Copier package.json et package-lock.json pour utiliser le cache Docker
|
|
COPY package*.json ./
|
|
|
|
# Installer les dépendances
|
|
RUN npm install
|
|
|
|
# Copier tout le code source
|
|
COPY . .
|
|
|
|
# Lancer le build Vite + Tailwind
|
|
RUN npm run build
|
|
|
|
# ===========================
|
|
# Production stage
|
|
# ===========================
|
|
FROM nginx:alpine
|
|
|
|
# Copier les fichiers build depuis le stage précédent
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
# Exposer le port 80
|
|
EXPOSE 80
|
|
|
|
# Lancer Nginx
|
|
CMD ["nginx", "-g", "daemon off;"]
|