Files
gameovergne-app/client/Dockerfile

32 lines
700 B
Docker

# ===== STAGE 1 : build Angular =====
FROM node:20-alpine AS build
WORKDIR /app
# Dépendances
COPY package*.json ./
RUN npm ci
# Code source
COPY . .
# Build Angular en mode prod
RUN npm run build -- --configuration production
# ===== STAGE 2 : Nginx pour servir le build =====
FROM nginx:1.27-alpine
# On nettoie la racine Nginx
RUN rm -rf /usr/share/nginx/html/*
# IMPORTANT :
# On copie le build Angular directement dans /usr/share/nginx/html
# (et NON dans /usr/share/nginx/html/gameovergne)
COPY --from=build /app/dist/client/ /usr/share/nginx/html/
# On remplace la conf par notre conf appli
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]