-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (30 loc) · 964 Bytes
/
Dockerfile
File metadata and controls
40 lines (30 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Étape de build
FROM node:18-alpine AS build
WORKDIR /app
# Copier les fichiers de configuration
COPY package.json ./
COPY tsconfig.json ./
COPY tsconfig.app.json ./
COPY tsconfig.node.json ./
COPY vite.config.ts ./
COPY postcss.config.js ./
COPY tailwind.config.js ./
COPY eslint.config.js ./
COPY index.html ./
COPY .env ./
# Installer les dépendances avec une meilleure gestion des erreurs
RUN npm install --no-fund --no-audit --loglevel=error || (echo "Erreur lors de l'installation des dépendances" && exit 1)
# Copier le code source
COPY src/ ./src/
# Construire l'application
RUN npm run build
# Étape de production
FROM nginx:alpine AS production
# Copier la configuration nginx
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
# Copier les fichiers de build depuis l'étape précédente
COPY --from=build /app/dist /usr/share/nginx/html
# Exposer le port 80
EXPOSE 80
# Commande pour démarrer nginx
CMD ["nginx", "-g", "daemon off;"]