Created
November 11, 2020 23:15
-
-
Save gm50x/18a8103a86258e72736f781f4a9ab875 to your computer and use it in GitHub Desktop.
Node-Nestjs multiphased dockerfile
This file contains 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:lts-alpine3.12 AS build | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . . | |
RUN npm run build | |
FROM node:lts-alpine3.12 AS runtime | |
ARG NODE_ENV=production | |
ENV NODE_ENV=${NODE_ENV} | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm ci --only=production | |
COPY --from=build /usr/src/app/dist/* ./ | |
CMD [ "node", "main" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment