27 lines
659 B
Text
27 lines
659 B
Text
FROM quay.io/urec56/python312
|
|
|
|
RUN addgroup --system app && adduser --system --group app
|
|
|
|
ENV APP_HOME=/home/app
|
|
|
|
WORKDIR $APP_HOME
|
|
|
|
RUN apt-get update \
|
|
&& apt-get -y install curl gcc libpq-dev \
|
|
&& apt-get clean
|
|
|
|
COPY requirements.txt .
|
|
|
|
RUN pip config set global.trusted-host "pypi.python.org pypi.org files.pythonhosted.org" && \
|
|
pip install --upgrade pip setuptools \
|
|
pip install -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
RUN chown -R app:app $APP_HOME
|
|
|
|
USER app
|
|
|
|
CMD ["gunicorn", "app.main:app", "--workers", "2", "--worker-class", "uvicorn.workers.UvicornWorker",\
|
|
"--bind=0.0.0.0:8000", "--max-requests", "500", "--max-requests-jitter", "50"]
|
|
|