Created
August 19, 2018 18:48
-
-
Save Midnighter/44c5613121bc3a19064d209b8343d6e1 to your computer and use it in GitHub Desktop.
A basic docker image definition for running API Star with gunicorn and uvicorn workers.
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.6-slim | |
ENV PYTHONUNBUFFERED=1 | |
RUN mkdir -p /app | |
WORKDIR /app | |
COPY Pipfile* ./ | |
RUN set -eux \ | |
&& apt-get update \ | |
&& apt-get install --yes --only-upgrade openssl ca-certificates \ | |
&& apt-get install --yes --no-install-recommends \ | |
build-essential \ | |
&& pip install --upgrade pip setuptools wheel pipenv \ | |
&& pipenv install --system --dev --deploy \ | |
&& rm -rf /root/.cache/pip \ | |
&& apt-get purge --yes build-essential \ | |
&& apt-get autoremove --yes \ | |
&& apt-get clean \ | |
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
COPY app.py /app/ | |
CMD ["gunicorn", "app:app", "-b", "0.0.0.0", "-w", "3", "-k", "uvicorn.workers.UvicornWorker"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment