Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chrisedrego/95c4f6da3d191293e16f854120937de2 to your computer and use it in GitHub Desktop.
Save chrisedrego/95c4f6da3d191293e16f854120937de2 to your computer and use it in GitHub Desktop.
mutli-stage-dockerfle
# BUILD STAGE: Building the Application
FROM node:10 AS build
WORKDIR /myapp
COPY package.json index.js ./
RUN npm install ./
RUN npm run build
# Execution: Final Built Application
FROM mhart/alpine-node:10
WORKDIR /myapp
COPY --from=build /app/index.js ./
EXPOSE 8080
CMD ["node", "/app/index.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment