Created
July 15, 2020 20:32
-
-
Save trvrm/360961be6301d141eb4e3b6f1bb3a6db to your computer and use it in GitHub Desktop.
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.6 as build | |
RUN pip install pipenv | |
WORKDIR /app | |
COPY Pipfile Pipfile.lock /app/ | |
RUN PIPENV_VENV_IN_PROJECT=1 pipenv sync | |
FROM python:3.6-slim as application | |
COPY --from=build /app/.venv /app/.venv/ | |
COPY ./myapp /app/myapp | |
EXPOSE 80 | |
CMD ["/app/.venv/bin/uvicorn", "--port","80", "--host","0.0.0.0", "myapp:app"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Skeleton for build Python apps in docker using multistage builds and Pipenv.