Skip to content

Instantly share code, notes, and snippets.

@pyldin601
Created September 20, 2018 07:46
Show Gist options
  • Save pyldin601/012ad25c5bc6a99684ce33a448556525 to your computer and use it in GitHub Desktop.
Save pyldin601/012ad25c5bc6a99684ce33a448556525 to your computer and use it in GitHub Desktop.
Multi-stage build of typescript node application example
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