v1.0 with SW PWA enabled
This commit is contained in:
@ -1,33 +1,33 @@
|
||||
# ===========================
|
||||
# Build stage
|
||||
# ===========================
|
||||
FROM node:20-bullseye AS builder
|
||||
# --- Étape 1 : Build du frontend ---
|
||||
FROM node:22-alpine AS builder
|
||||
|
||||
# Définir le répertoire de travail
|
||||
# Création du dossier
|
||||
WORKDIR /app
|
||||
|
||||
# Copier package.json et package-lock.json pour utiliser le cache Docker
|
||||
COPY package*.json ./
|
||||
# Installation des dépendances
|
||||
COPY package.json package-lock.json ./
|
||||
|
||||
# Installer les dépendances
|
||||
RUN npm install
|
||||
RUN npm install --legacy-peer-deps
|
||||
|
||||
# Copier tout le code source
|
||||
# Copie du code source
|
||||
COPY . .
|
||||
|
||||
# Lancer le build Vite + Tailwind
|
||||
# Build du projet
|
||||
RUN npm run build
|
||||
|
||||
# ===========================
|
||||
# Production stage
|
||||
# ===========================
|
||||
# --- Étape 2 : Serveur web (Nginx) ---
|
||||
FROM nginx:alpine
|
||||
|
||||
# Copier les fichiers build depuis le stage précédent
|
||||
# Suppression de la config par défaut
|
||||
RUN rm -rf /usr/share/nginx/html/*
|
||||
|
||||
# Copie du build
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
|
||||
# Exposer le port 80
|
||||
# Copie (optionnelle) d'une config Nginx personnalisée
|
||||
# COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
# Lancer Nginx
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user