dockerfile for static demo
This commit is contained in:
parent
963adaa8c8
commit
4994c9b12a
1 changed files with 13 additions and 9 deletions
22
Dockerfile
22
Dockerfile
|
@ -9,18 +9,22 @@ COPY my-workspace/projects/sae-lib/package*.json ./my-workspace/projects/sae-lib
|
||||||
|
|
||||||
|
|
||||||
# Copier le reste des sources
|
# Copier le reste des sources
|
||||||
COPY ./my-workspace/projects/sae-lib ./my-workspace/projects/sae-lib
|
#COPY ./my-workspace/projects/sae-lib ./my-workspace/projects/sae-lib
|
||||||
COPY ./sae-csc ./sae-csc
|
#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)
|
FROM nginx:1.27-alpine as production
|
||||||
RUN cd sae-csc && npm ci
|
|
||||||
|
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/*
|
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
|
EXPOSE 80
|
||||||
CMD ["nginx","-g","daemon off;"]
|
CMD ["nginx","-g","daemon off;"]
|
Loading…
Add table
Add a link
Reference in a new issue