-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use multi-staged build for clean frontend image
- Loading branch information
1 parent
d9da80d
commit 6d6b29b
Showing
1 changed file
with
10 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/"] |