Skip to content

Instantly share code, notes, and snippets.

@EnriqueTejeda
Created June 10, 2022 18:33
Show Gist options
  • Save EnriqueTejeda/35667d2f7daf40afc46b8a0c844da17f to your computer and use it in GitHub Desktop.
Save EnriqueTejeda/35667d2f7daf40afc46b8a0c844da17f to your computer and use it in GitHub Desktop.
Dockerfile Multi-stage Nodejs
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