Skip to content

Instantly share code, notes, and snippets.

@eduardomp
Created September 28, 2020 16:37
Show Gist options
  • Save eduardomp/8c89cbf822c32ecd02f90e295f828ac9 to your computer and use it in GitHub Desktop.
Save eduardomp/8c89cbf822c32ecd02f90e295f828ac9 to your computer and use it in GitHub Desktop.
Dockerfile for Vue applications
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