Skip to content

Commit

Permalink
Remove npm update, pin pnpm version + use the one from package.json f…
Browse files Browse the repository at this point in the history
…or the project
  • Loading branch information
SayuShira committed Oct 24, 2023
1 parent 42f3936 commit c4abbe1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
FROM node:lts-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
WORKDIR /app

RUN npm install -g npm@latest
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh -

FROM base AS deps

# This PNPM_VERSION is used to install the dependencies. Those include a possibly different version of pnpm
# that is to be used for the package. Found in package.json - packageManager
ENV PNPM_VERSION=8.6.2

ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN wget -qO- https://get.pnpm.io/install.sh | ENV="$HOME/.shrc" SHELL="$(which sh)" sh -

COPY . /app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile


FROM base
COPY --from=deps /app/node_modules /app/node_modules

Expand Down

0 comments on commit c4abbe1

Please sign in to comment.