Created
December 17, 2022 22:31
-
-
Save theetrain/84adfd38daa4b03cfd600e129950e44d to your computer and use it in GitHub Desktop.
Node Dockerfile
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
FROM node:18.12.1-alpine3.16 as nodebuilder | |
WORKDIR /app | |
COPY . . | |
RUN npm i | |
RUN npm run build | |
CMD npm i && npm start | |
# Run | |
# ==== | |
FROM node:18.12.1-alpine3.16 | |
WORKDIR /srv | |
COPY --from=nodebuilder /app/build /srv | |
COPY --from=nodebuilder /app/package*.json /srv/ | |
RUN npm i --production | |
EXPOSE 3000 | |
CMD node . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment