Skip to content

Instantly share code, notes, and snippets.

@sand97
Last active January 20, 2022 13:35
Show Gist options
  • Save sand97/957cce45e892afd28ff3f41ddc7f999a to your computer and use it in GitHub Desktop.
Save sand97/957cce45e892afd28ff3f41ddc7f999a to your computer and use it in GitHub Desktop.
NestJS DockerFile
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