Created
September 28, 2020 16:37
-
-
Save eduardomp/8c89cbf822c32ecd02f90e295f828ac9 to your computer and use it in GitHub Desktop.
Dockerfile for Vue applications
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
FROM renovate/yarn:latest as build-stage | |
LABEL maintainer="Eduardo Medeiros Pereira - edu.medeirospereira@gmail.com" | |
LABEL description="Dockerfile for Vue applications" | |
USER root | |
RUN adduser --disabled-password --gecos '' vue \ | |
&& adduser vue sudo \ | |
&& echo '%sudo ALL=(ALL:ALL) ALL' >> /etc/sudoers | |
RUN mkdir -p /app && \ | |
chown vue /app | |
USER vue | |
WORKDIR /app | |
COPY . . | |
RUN cd /app && \ | |
yarn install && \ | |
yarn build | |
FROM nginx:stable-alpine as production-stage | |
COPY --from=build-stage /app/dist /usr/share/nginx/html | |
EXPOSE 80 | |
CMD ["nginx", "-g", "daemon off;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment