Skip to content

Instantly share code, notes, and snippets.

@qwo
Last active November 24, 2021 18:50
Show Gist options
  • Save qwo/b970a50059569316565244e9ea129ef3 to your computer and use it in GitHub Desktop.
Save qwo/b970a50059569316565244e9ea129ef3 to your computer and use it in GitHub Desktop.
gunicorn docker
FROM python:3.7.2
COPY . /app
WORKDIR /app
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | POETRY_HOME=/opt/poetry python
ENV PATH="${PATH}:/opt/poetry/bin"
RUN ln -s /opt/poetry/bin/poetry poetry
RUN poetry config virtualenvs.create false
RUN poetry install --no-root --no-dev
ENV PORT 8000
WORKDIR "dockerip"
CMD ["gunicorn", "--bind", "$PORT", "main:app"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment