Skip to content

Commit

Permalink
build: add missing node_modules folder in the end stage
Browse files Browse the repository at this point in the history
  • Loading branch information
samhwang committed Apr 26, 2024
1 parent 59c86ed commit 8250c9a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ RUN pnpm install --frozen-lockfile --ignore-scripts
COPY . .

ENV NODE_ENV=production
RUN pnpm build
RUN pnpm build && \
pnpm install --production --frozen-lockfile --ignore-scripts

####################
# Production image #
Expand All @@ -23,6 +24,7 @@ FROM node:20.10-slim as production
WORKDIR /app

COPY --chown=node:node --from=build /app/dist dist
COPY --chown=node:node --from=build /app/node_modules node_modules

USER node
ENV NODE_ENV=production
Expand Down

0 comments on commit 8250c9a

Please sign in to comment.