Skip to content

Commit

Permalink
Refactor: use offline install in the second stage
Browse files Browse the repository at this point in the history
  • Loading branch information
kmc7468 committed Nov 26, 2024
1 parent 6acd1c2 commit a8c91e6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,18 @@ FROM node:18-alpine

WORKDIR /usr/src/app

# Install pnpm
RUN npm install --global [email protected]

# 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
Expand Down

0 comments on commit a8c91e6

Please sign in to comment.