Created
February 21, 2019 19:04
-
-
Save MaximRouiller/cee13b5963919e9e308c812f085a75d9 to your computer and use it in GitHub Desktop.
NodeJS Multistage Dockerfile
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
#build stage for a Node.js application | |
FROM node:lts-alpine as build-stage | |
WORKDIR /app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . . | |
RUN npm run build | |
#production stage | |
FROM nginx:stable-alpine as production-stage | |
COPY --from=build-stage /app/dist /usr/share/nginx/html | |
EXPOSE 80 | |
CMD ["nginx", "-g", "daemon off;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment