Skip to content

Instantly share code, notes, and snippets.

@robsoncezario
Created July 24, 2022 16:21
Show Gist options
  • Save robsoncezario/fb8c1197692d54e11eee3289e73dda13 to your computer and use it in GitHub Desktop.
Save robsoncezario/fb8c1197692d54e11eee3289e73dda13 to your computer and use it in GitHub Desktop.
A docker file for nest js
FROM node:16-alpine AS base
WORKDIR /app
COPY [ "package*.json", "tsconfig.build.json", "tsconfig.json", ".eslintrc.js", ".prettierrc", "yarn.lock" , "./" ]
FROM base AS dev
ENV NODE_ENV=dev
RUN yarn install --frozen-lockfile
COPY . .
EXPOSE 3001
CMD [ "yarn", "start:dev" ]
FROM base AS prod
ENV NODE_ENV=production
RUN yarn install --frozen-lockfile --production
COPY . .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment