Created
March 5, 2023 16:05
-
-
Save aled1027/3a994d4c0d3b9ac525e9532ceac38f7b to your computer and use it in GitHub Desktop.
Fly Python Dockerfile
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.10 | |
# set work directory | |
WORKDIR /usr/src/app | |
# set environment variables | |
ENV PYTHONDONTWRITEBYTECODE 1 | |
ENV PYTHONUNBUFFERED 1 | |
COPY . . | |
# install dependencies | |
RUN pip install poetry | |
RUN poetry config virtualenvs.create false \ | |
&& poetry install | |
EXPOSE 8000 | |
# This command is good for just getting it running. This will run the server on port 8000 | |
CMD ["poetry", "run", "python", "manage.py", "runserver"] | |
# or | |
# CMD ["poetry", "run", "python", "-m", "uvicorn", "config.asgi:application", "--host", "0.0.0.0", "--port", "8000"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment