-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: use offline install in the second stage
- Loading branch information
Showing
1 changed file
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|