Created
September 20, 2018 07:46
-
-
Save pyldin601/012ad25c5bc6a99684ce33a448556525 to your computer and use it in GitHub Desktop.
Multi-stage build of typescript node application example
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:10 | |
ENV NODE_ENV=development | |
WORKDIR /app | |
COPY package.json package-lock.json ./ | |
RUN npm install | |
COPY . ./ | |
RUN npm run build | |
FROM node:10 | |
ENV NODE_ENV=production | |
WORKDIR /app | |
COPY --from=0 /app/package.json /app/package-lock.json ./ | |
COPY --from=0 /app/dist ./dist | |
RUN npm install | |
CMD npm start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment