Created
February 21, 2020 14:37
-
-
Save yagoernandes/2c7b1103ebc84104d5133d55a5f782d8 to your computer and use it in GitHub Desktop.
Dockerfile for Node (Production)
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.16 | |
EXPOSE 8080 | |
WORKDIR /app/ | |
COPY . . | |
COPY package*.json ./ | |
RUN npm install | |
RUN npm run build | |
RUN echo "finished building" | |
RUN ls -afl dist | |
FROM node:10.16-alpine | |
WORKDIR /app/ | |
COPY --from=0 /app/dist ./dist | |
COPY package*.json ./ | |
COPY --from=0 /app/node_modules ./node_modules | |
ENTRYPOINT NODE_ENV=production npm run start:prod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment