Created
June 10, 2022 18:33
-
-
Save EnriqueTejeda/35667d2f7daf40afc46b8a0c844da17f to your computer and use it in GitHub Desktop.
Dockerfile Multi-stage Nodejs
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:16 AS BUILDER | |
WORKDIR /app | |
COPY . . | |
RUN npm install --prod | |
RUN npm run build | |
FROM node:16-slim | |
ENV TZ=America/Cancun | |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone | |
WORKDIR /app | |
COPY --from=BUILDER /app . | |
EXPOSE 3000 | |
CMD ["npm","run","serve"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment