Skip to content

Instantly share code, notes, and snippets.

@StanGirard
Created October 14, 2020 07:18
Show Gist options
  • Save StanGirard/ee0abc99b0872ba96d12a5752ec1efb9 to your computer and use it in GitHub Desktop.
Save StanGirard/ee0abc99b0872ba96d12a5752ec1efb9 to your computer and use it in GitHub Desktop.
docker multi staging example
# Pulls the official image
FROM node:13.12.0-alpine
# Sets the working dir
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# Install all the dependencies
COPY package.json ./
RUN npm install babel-polyfill # Necessary dependency for production build
RUN npm install --silent --only=prod # Only production dependencies
# Add the App Code
COPY . ./
# Script that starts the app
RUN npm run build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment