Skip to content

Commit

Permalink
ci: add three steps of running yarn install in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
moolmin committed Sep 24, 2024
1 parent 042eb6c commit 9140528
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@ FROM --platform=linux/arm64 pre AS deps
WORKDIR /app
# RUN npm install -g node-gyp
COPY package.json ./
RUN yarn install --immutable

RUN \
if [ -f yarn.lock ]; then yarn install --immutable; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi
# 2. Rebuild the source code only when needed
FROM --platform=linux/arm64 pre AS builder
WORKDIR /app
Expand Down

0 comments on commit 9140528

Please sign in to comment.