feat: v1
This commit is contained in:
27
frontend/Dockerfile
Normal file
27
frontend/Dockerfile
Normal file
@ -0,0 +1,27 @@
|
||||
# --- Étape 1 : build de l'application Angular ---
|
||||
FROM node:22-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Installation des dépendances (couche mise en cache tant que les manifestes
|
||||
# ne changent pas). On utilise `npm ci` si un lockfile est présent, sinon
|
||||
# `npm install` (utile tant que le lockfile n'a pas encore été généré/commité).
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
||||
|
||||
# Copie du code source et build de production.
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# --- Étape 2 : service par nginx ---
|
||||
FROM nginx:1.27-alpine
|
||||
|
||||
# Configuration nginx (SPA + proxy /api -> backend:8080).
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Copie du build Angular dans la racine servie par nginx.
|
||||
COPY --from=build /app/dist/pdfeditor-frontend/browser /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
Reference in New Issue
Block a user