Skip to content

Commit

Permalink
Add cache to yarn install (#629)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewy-gh authored Oct 8, 2024
1 parent fef338d commit edf2886
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions frontend/front/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Stage 1: Use yarn to build the app
FROM node:18 as builder
FROM node:18-alpine as builder

ARG REACT_APP_API_URL
ENV REACT_APP_API_URL=$REACT_APP_API_URL
Expand All @@ -17,8 +17,13 @@ ARG REACT_APP_GIT_REF
ENV REACT_APP_GIT_REF=$REACT_APP_GIT_REF

WORKDIR /usr/src/app

COPY frontend/front/package.json frontend/front/yarn.lock ./

RUN --mount=type=cache,target=/usr/local/share/.cache/yarn/v6 \
yarn install --frozen-lockfile

COPY frontend/front/ ./
RUN yarn
RUN yarn build

# Stage 2: Copy the JS React SPA into the Nginx HTML directory
Expand Down

0 comments on commit edf2886

Please sign in to comment.