Skip to content

Instantly share code, notes, and snippets.

@gorbiz
Created February 27, 2018 06:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gorbiz/c89590bfeb1db974d057480d0b64fc4a to your computer and use it in GitHub Desktop.
Save gorbiz/c89590bfeb1db974d057480d0b64fc4a to your computer and use it in GitHub Desktop.
Multi-stage build for vue front-end
FROM node:8.9.4-alpine AS build_box
WORKDIR /app
COPY package*.json ./
RUN NODE_ENV=dev npm install
COPY . /app
RUN npm run build
# Make final image
FROM node:8.9.4-alpine
WORKDIR /app
COPY index.js ./
COPY package*.json ./
COPY --from=build_box /app/dist ./dist
RUN npm install --production
EXPOSE 80
CMD [ "npm", "start" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment