Last active
March 6, 2020 05:43
-
-
Save zynaxsoft/d055311397c57ea5c20af9a0c6d75ff9 to your computer and use it in GitHub Desktop.
Dockerfile for private repo
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 python:3.9-rc-buster as intermediate | |
COPY requirements.txt /app/ | |
WORKDIR /app | |
ARG SSH_PRIVATE_KEY | |
# ssh setup | |
RUN mkdir /root/.ssh/ | |
RUN echo "${SSH_PRIVATE_KEY}" >> /root/.ssh/id_rsa && chmod 600 /root/.ssh/id_rsa | |
RUN touch /root/.ssh/known_hosts | |
RUN ssh-keyscan -t rsa github.com >> /root/.ssh/known_hosts | |
ENV VIRTUAL_ENV=/opt/venv | |
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | |
RUN python3 -m venv $VIRTUAL_ENV | |
RUN pip3 install -r requirements.txt | |
FROM python:3.9-rc-buster | |
COPY --from=intermediate /opt/venv /opt/venv | |
ENV VIRTUAL_ENV=/opt/venv | |
ENV PATH="$VIRTUAL_ENV/bin:$PATH" | |
WORKDIR /app | |
COPY . /app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Building