Created
June 26, 2020 13:02
-
-
Save chrisedrego/95c4f6da3d191293e16f854120937de2 to your computer and use it in GitHub Desktop.
mutli-stage-dockerfle
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
# 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