Skip to content

Instantly share code, notes, and snippets.

@fiveisprime
Created July 10, 2018 18:31
Show Gist options
  • Save fiveisprime/eb99f12593ff53949dd31e1495f1b7b8 to your computer and use it in GitHub Desktop.
Save fiveisprime/eb99f12593ff53949dd31e1495f1b7b8 to your computer and use it in GitHub Desktop.
# Base
FROM node:8.11.3-alpine AS base
WORKDIR /usr/src/app
COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
# Dependencies
FROM base AS dependencies
RUN npm install --production --silent
RUN cp -R node_modules prod_node_modules
RUN npm install --silent
# Build
FROM dependencies AS base
COPY . .
RUN ./build.js
# Release
FROM build AS release
COPY --from=dependencies /root/chat/prod_node_modules ./node_modules
COPY . .
ENV NODE_ENV production
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment