Last active
January 20, 2022 13:35
-
-
Save sand97/957cce45e892afd28ff3f41ddc7f999a to your computer and use it in GitHub Desktop.
NestJS DockerFile
This file contains hidden or 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
FROM node:12.13-alpine As development | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . . | |
RUN npx prisma generate | |
RUN npm run build | |
FROM node:12.13-alpine as production | |
ARG NODE_ENV=production | |
ENV NODE_ENV=${NODE_ENV} | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . . | |
RUN npx prisma generate | |
COPY --from=development /usr/src/app/dist ./dist | |
CMD ["node", "dist/main"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment