Skip to content

Instantly share code, notes, and snippets.

@phillies
Created June 4, 2019 05:36
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 phillies/c04d56711cfee35404e65e823497b77a to your computer and use it in GitHub Desktop.
Save phillies/c04d56711cfee35404e65e823497b77a to your computer and use it in GitHub Desktop.
Multi-stage build with ssh-login to github using deploy keys
FROM node as builder
COPY github_key .
RUN eval $(ssh-agent) && \
ssh-add github_key && \
ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts && \
git clone git@github.com:phillies/vue_example.git /opt/vue_example
WORKDIR /opt/vue_example
RUN npm install && npm run build
FROM nginx
COPY --from=builder /opt/vue_example/dist/ /usr/share/nginx/html/
EXPOSE 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment