Skip to content

Commit

Permalink
[CHORE] dockerfile 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekks authored Mar 18, 2024
1 parent c794feb commit 52ca03c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ FROM node:18-alpine As build

WORKDIR /usr/src/app

ENV NODE_ENV=dev

COPY --chown=node:node package*.json ./

# In order to run `npm run build` we need access to the Nest CLI which is a dev dependency. In the previous development stage we ran `npm ci` which installed all dependencies, so we can copy over the node_modules directory from the development image
Expand All @@ -54,10 +56,12 @@ USER node

FROM node:18-alpine As production

ENV NODE_ENV=dev

# Copy the bundled code from the build stage to the production image
COPY --chown=node:node --from=build /usr/src/app/node_modules ./node_modules
COPY --chown=node:node --from=build /usr/src/app/dist ./dist
COPY --chown=node:node --from=build /usr/src/app/*.env ./

# Start the server using the production build
CMD [ "node", "dist/main.js" ]
CMD [ "node", "dist/main.js" ]

0 comments on commit 52ca03c

Please sign in to comment.