Last active
November 18, 2020 22:26
-
-
Save theoparis/2d1ded4774380d50c06ec3cc29fe4a9e to your computer and use it in GitHub Desktop.
python3 docker w/ poetry
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-alpine | |
RUN mkdir /app | |
WORKDIR /app | |
RUN pip install poetry poethepoet | |
RUN poetry config settings.virtualenvs.create false | |
COPY poetry.lock pyproject.toml README.md /app/ | |
# to prevent poetry from installing my actual app, | |
# and keep docker able to cache layers | |
RUN mkdir -p /app/src/app | |
RUN touch /app/src/app/__init__.py | |
RUN poetry install -n | |
# now actually copy the real contents of my app | |
COPY app /app/src/app | |
EXPOSE 8000 | |
CMD ["poe", "start"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment