docker running dev server of csc
This commit is contained in:
parent
eaa0752845
commit
762069f7a1
3 changed files with 49 additions and 10050 deletions
38
Dockerfile
38
Dockerfile
|
@ -3,28 +3,28 @@
|
|||
FROM node:24 AS build
|
||||
WORKDIR /app
|
||||
|
||||
# Copier package.json des deux projets pour tirer parti du cache
|
||||
COPY sae-csc/package*.json ./sae-csc/
|
||||
COPY my-workspace/projects/sae-lib/package*.json ./my-workspace/projects/sae-lib/
|
||||
# Étape 1: préparer le cache d'installation
|
||||
# On copie d'abord uniquement les manifests pour optimiser le cache Docker
|
||||
COPY my-workspace/package.json my-workspace/package-lock.json* ./my-workspace/
|
||||
COPY sae-csc/package.json sae-csc/package-lock.json* ./sae-csc/
|
||||
|
||||
# Installer les dépendances de la workspace qui contient la librairie
|
||||
WORKDIR /app/my-workspace
|
||||
RUN npm i
|
||||
|
||||
# Copier le reste des sources
|
||||
#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
|
||||
# Copier l'intégralité des sources de la workspace et builder la librairie "sae-lib"
|
||||
COPY my-workspace/ ./
|
||||
RUN npx ng build sae-lib
|
||||
|
||||
FROM nginx:1.27-alpine as production
|
||||
# Installer les dépendances de l'application (qui dépend de ../my-workspace/dist/sae-lib)
|
||||
WORKDIR /app/sae-csc
|
||||
RUN npm i
|
||||
|
||||
RUN apk add --no-cache bash
|
||||
RUN apk add --no-cache nano
|
||||
# Copier le reste des sources de l'application
|
||||
COPY sae-csc/ ./
|
||||
|
||||
# lancer en mode dev et exposer le port 4200
|
||||
EXPOSE 4200
|
||||
|
||||
RUN rm -rf /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;"]
|
||||
# Lancer le serveur Angular en écoutant sur toutes les interfaces
|
||||
CMD ["npm","start","--","--host","0.0.0.0"]
|
10031
blueprint/package-lock.json
generated
10031
blueprint/package-lock.json
generated
File diff suppressed because it is too large
Load diff
30
devops/Dockerfile static
Normal file
30
devops/Dockerfile static
Normal file
|
@ -0,0 +1,30 @@
|
|||
# lancer le build:
|
||||
# docker build -f /home/poule/encrypted/stockage-syncable/www/development/html/ng-implementation/Dockerfile -t csc-app:latest /home/poule/encrypted/stockage-syncable/www/development/html/ng-implementation#
|
||||
FROM node:24 AS build
|
||||
WORKDIR /app
|
||||
|
||||
# Copier package.json des deux projets pour tirer parti du cache
|
||||
COPY sae-csc/package*.json ./sae-csc/
|
||||
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
|
||||
RUN mkdir /app/static
|
||||
COPY ./blueprint/static ./app/static
|
||||
|
||||
FROM nginx:1.27-alpine as production
|
||||
|
||||
RUN apk add --no-cache bash
|
||||
RUN apk add --no-cache nano
|
||||
|
||||
|
||||
RUN rm -rf /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;"]
|
Loading…
Add table
Add a link
Reference in a new issue