25 lines
466 B
Docker
25 lines
466 B
Docker
# ---------- Stage 1 : build Angular ----------
|
|
FROM node:20-alpine AS build
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
|
|
COPY . .
|
|
|
|
# Build Angular en mode prod
|
|
RUN npm run build
|
|
|
|
# ---------- Stage 2 : Nginx pour servir le build ----------
|
|
FROM nginx:alpine
|
|
|
|
# Notre conf Nginx custom
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Copie du build Angular
|
|
COPY --from=build /app/dist/client /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"] |