Created
May 25, 2018 13:15
-
-
Save gambtho/3c3b7ac2f3a9703f2a8762464c9967a8 to your computer and use it in GitHub Desktop.
Dockerfile for Vuejs/Nginx
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 as development | |
WORKDIR /app | |
ADD package.json /app/ | |
ADD package-lock.json /app/ | |
ADD yarn.lock /app/ | |
RUN yarn | |
ADD public /app/public | |
ADD robots.txt /app/ | |
ADD src /app/src | |
ADD tests /app/tests | |
ADD .??* /app/ | |
ADD *.js /app/ | |
ADD *.js* /app/ | |
RUN yarn build | |
FROM alpine as production | |
RUN apk add --no-cache nginx | |
EXPOSE 8080 | |
WORKDIR /app | |
COPY --from=development /app/dist ./dist | |
COPY --from=development /app/robots.txt ./dist/robots.txt | |
RUN tar cvzf dist.tar.gz dist/ | |
ADD misc/nginx.default /etc/nginx/conf.d/default.conf | |
ADD misc/nginx.conf /etc/nginx/nginx.conf | |
CMD ["nginx"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment