Created
April 9, 2020 22:45
-
-
Save germainlefebvre4/74ee635ff54e4e5aad5acc32d7986c99 to your computer and use it in GitHub Desktop.
Build docker image for python app based on pipenv development
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 python:3.8-alpine AS base | |
FROM base as builder | |
RUN apk update && \ | |
apk add py-pip && \ | |
pip install pipenv | |
# Update pipenv libs | |
COPY Pipfile* ./ | |
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy | |
FROM base as runner | |
# Python libs and sources | |
COPY --from=builder /.venv/lib/python3.8/site-packages /usr/local/lib/python3.8/site-packages | |
COPY main.py . | |
CMD ["python", "main.py"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment