Skip to content

Instantly share code, notes, and snippets.

@wookets
Created September 10, 2019 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wookets/0d196de017e74f8e7ee9001e5a9c89f4 to your computer and use it in GitHub Desktop.
Save wookets/0d196de017e74f8e7ee9001e5a9c89f4 to your computer and use it in GitHub Desktop.
Docker: Multi-stage build dockerfile vuejs
# first stage builds vue
FROM mhart/alpine-node:12 as build-stage
WORKDIR /app
COPY . .
RUN npm ci
RUN npm run build
# second stage copies only the static dist files to nginx html dir
FROM nginx:stable-alpine as production-stage
VOLUME /var/log/nginx
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment