Skip to content

Commit

Permalink
fix: use multi-staged build for clean frontend image
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalinDe committed Sep 8, 2023
1 parent d9da80d commit 52204fa
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Dockerfiles/Dockerfile.frontend
Original file line number Diff line number Diff line change
@@ -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/", "--bind", "127.0.0.1"]

0 comments on commit 52204fa

Please sign in to comment.