Created
June 4, 2019 05:36
-
-
Save phillies/c04d56711cfee35404e65e823497b77a to your computer and use it in GitHub Desktop.
Multi-stage build with ssh-login to github using deploy keys
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 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