Skip to content

Instantly share code, notes, and snippets.

@Midnighter
Created August 20, 2018 18:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Midnighter/6f848a1b2264fa453706284305673834 to your computer and use it in GitHub Desktop.
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
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