From b677992c7f37b100582c64c4938ade01ac166ba7 Mon Sep 17 00:00:00 2001 From: "aurian.jault" Date: Mon, 1 Jul 2024 00:56:08 +0200 Subject: [PATCH] d --- Dockerfile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 078dbf9..3f8a91a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,13 @@ -FROM node:alpine - -WORKDIR /usr/src/app - -COPY . /usr/src/app +# Stage 1: Compile and Build angular codebase +FROM node:latest as build +WORKDIR /usr/local/app +COPY ./ /usr/local/app/ +RUN npm install +RUN npm run build -RUN npm install -g @angular/cli -RUN npm install +# Stage 2: Serve app with nginx server +FROM nginx:latest +COPY --from=build /usr/local/app/dist/portofolio /usr/share/nginx/html -CMD ["ng", "serve", "--host", "0.0.0.0"] +EXPOSE 80