Skip to content

Commit

Permalink
Use multi-stage build for frontend container.
Browse files Browse the repository at this point in the history
  • Loading branch information
fniessink committed Nov 13, 2024
1 parent e568487 commit dc7335c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
20 changes: 12 additions & 8 deletions components/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
FROM node:23.1.0-alpine3.20 AS compile-image

WORKDIR /home/frontend
COPY public /home/frontend/public
COPY package*.json /home/frontend
COPY src /home/frontend/src
COPY .env /home/frontend
RUN npm install --ignore-scripts && \
npm run --ignore-scripts build

FROM node:23.1.0-alpine3.20

LABEL maintainer="Quality-time team <[email protected]>"
LABEL description="Quality-time frontend"

WORKDIR /home/frontend
COPY package*.json /home/frontend
COPY public /home/frontend/public
COPY src /home/frontend/src
COPY healthcheck.js /home/frontend
COPY .env /home/frontend
RUN npm install --ignore-scripts -g [email protected] && \
npm install --ignore-scripts && \
npm install --ignore-scripts -g [email protected] && \
npm run --ignore-scripts build && \
COPY --from=compile-image /home/frontend/build /home/frontend/build
RUN npm install --ignore-scripts -g [email protected] && \
adduser frontend --disabled-password
USER frontend

Expand Down
3 changes: 1 addition & 2 deletions components/renderer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ RUN apk add --no-cache \
chromium=130.0.6723.116-r0 && \
rm -rf /var/cache/apk/* /tmp/* && \
update-ms-fonts && \
fc-cache -f && \
npm install --ignore-scripts -g [email protected]
fc-cache -f

WORKDIR /home/renderer
COPY package*.json /home/renderer/
Expand Down

0 comments on commit dc7335c

Please sign in to comment.