Created
August 20, 2018 18:13
-
-
Save Midnighter/6f848a1b2264fa453706284305673834 to your computer and use it in GitHub Desktop.
A basic Docker image for running API Star with gunicorn and uvicorn workers on Alpine Linux
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-alpine3.7 | |
ENV PYTHONUNBUFFERED=1 | |
WORKDIR /app | |
COPY Pipfile* ./ | |
RUN set -eux \ | |
&& apk add --no-cache --virtual .build-deps build-base \ | |
&& pip install --upgrade pip setuptools wheel pipenv \ | |
&& pipenv install --system --dev --deploy \ | |
&& rm -rf /root/.cache/pip \ | |
&& apk del .build-deps | |
COPY app.py ./ | |
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