Created
September 5, 2021 14:58
-
-
Save rxhl/80b3e13aadfa01ace5cce7441920f838 to your computer and use it in GitHub Desktop.
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.8-slim | |
COPY ./requirements.txt /requirements.txt | |
COPY ./src /app | |
WORKDIR /app | |
RUN python -m venv /py && \ | |
/py/bin/pip install --upgrade pip && \ | |
/py/bin/pip install -r /requirements.txt && \ | |
adduser --disabled-password --no-create-home django-user | |
ENV PATH="/py/bin:$PATH" | |
ENV PYTHONDONTWRITEBYTECODE 1 | |
ENV PYTHONUNBUFFERED 1 | |
USER django-user | |
# Gunicorn as app server | |
CMD exec gunicorn --bind 0.0.0.0:$PORT --workers 1 --threads 8 --timeout 0 app.wsgi:application |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment