From a8c91e62ff6ee3ab8de3038b46479418790ccc8e Mon Sep 17 00:00:00 2001 From: static Date: Wed, 27 Nov 2024 04:24:16 +0900 Subject: [PATCH] Refactor: use offline install in the second stage --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3e328249..8a1a8894 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,15 +23,18 @@ FROM node:18-alpine WORKDIR /usr/src/app +# Install pnpm RUN npm install --global pnpm@8.8.0 +# devDependencies are not fetched COPY pnpm-lock.yaml . RUN pnpm fetch --prod COPY package.json . -RUN pnpm install --prod +RUN pnpm install --offline --prod -COPY --from=builder /usr/src/app/dist dist +# Copy the built app from the previous stage +COPY --from=builder /usr/src/app/dist ./dist # Run container EXPOSE 80