Created
September 10, 2019 15:18
-
-
Save wookets/0d196de017e74f8e7ee9001e5a9c89f4 to your computer and use it in GitHub Desktop.
Docker: Multi-stage build dockerfile vuejs
This file contains 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
# 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