Created
February 27, 2018 06:57
-
-
Save gorbiz/c89590bfeb1db974d057480d0b64fc4a to your computer and use it in GitHub Desktop.
Multi-stage build for vue front-end
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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