Skip to content

Instantly share code, notes, and snippets.

@Pythonista7
Created December 17, 2021 10:40
Show Gist options
  • Save Pythonista7/5ed8b7358dd305286660fc3e89e17477 to your computer and use it in GitHub Desktop.
Save Pythonista7/5ed8b7358dd305286660fc3e89e17477 to your computer and use it in GitHub Desktop.
# Common build stage
FROM node:14.14.0-alpine3.12 as common-build-stage
COPY . ./app
WORKDIR /app
RUN npm install
EXPOSE 3000
# Development build stage
FROM common-build-stage as development-build-stage
ENV NODE_ENV development
CMD ["npm", "run", "dev"]
# Production build stage
FROM common-build-stage as production-build-stage
ENV NODE_ENV production
CMD ["npm", "run", "start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment