dockerfile for static demo

This commit is contained in:
Tykayn 2025-10-08 16:07:53 +02:00 committed by tykayn
parent 963adaa8c8
commit 4994c9b12a

View file

@ -9,18 +9,22 @@ COPY my-workspace/projects/sae-lib/package*.json ./my-workspace/projects/sae-lib
# Copier le reste des sources
COPY ./my-workspace/projects/sae-lib ./my-workspace/projects/sae-lib
COPY ./sae-csc ./sae-csc
#COPY ./my-workspace/projects/sae-lib ./my-workspace/projects/sae-lib
#COPY ./sae-csc ./sae-csc
RUN mkdir /app/static
COPY ./blueprint/static ./app/static
# Installer (les scripts de postinstall peuvent casser, on les ignore si besoin)
RUN cd sae-csc && npm ci
FROM nginx:1.27-alpine as production
RUN apk add --no-cache bash
RUN apk add --no-cache nano
# Build de l'app Angular
RUN cd sae-csc && npm run build -- --configuration=production
FROM nginx:1.27-alpine
RUN rm -rf /usr/share/nginx/html/*
COPY --from=build /app/sae-csc/dist/sae-csc /usr/share/nginx/html
COPY ./blueprint/static ./usr/share/nginx/html
# Les fichiers sont déjà dans /app/static à l'étape build; inutile de recopier depuis le contexte
EXPOSE 80
CMD ["nginx","-g","daemon off;"]