From 6d6b29b110d9e6b06afcc30b19fa5262879574d6 Mon Sep 17 00:00:00 2001 From: Carine Dengler Date: Fri, 8 Sep 2023 14:52:12 +0200 Subject: [PATCH] fix: use multi-staged build for clean frontend image --- Dockerfiles/Dockerfile.frontend | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfiles/Dockerfile.frontend b/Dockerfiles/Dockerfile.frontend index ab04b319a..51dbdc47e 100644 --- a/Dockerfiles/Dockerfile.frontend +++ b/Dockerfiles/Dockerfile.frontend @@ -1,8 +1,15 @@ -FROM node:20-bookworm +FROM node:20-bookworm as build ENV REACT_APP_PROXY=http://localhost:9081 ENV REACT_APP_NOMOCK=on WORKDIR /web/frontend COPY ../web/frontend . -RUN npm install -ENTRYPOINT ["npm", "start"] +RUN npm ci +RUN npm run build + +FROM node:20-bookworm as app + +WORKDIR /web/frontend +COPY --from=build /web/frontend/build/ . + +ENTRYPOINT ["python3", "-m", "http.server", "3000", "--directory", "/web/frontend/"]