34 lines
639 B
Docker
34 lines
639 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PIP_NO_CACHE_DIR=1 \
|
|
PORT=5000
|
|
|
|
COPY requirements.txt ./
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
RUN mkdir -p /app/data /app/data/uploads /tmp /run/gunicorn \
|
|
&& chown -R 1000:1000 /app /tmp /run/gunicorn
|
|
|
|
USER 1000:1000
|
|
|
|
EXPOSE 5000
|
|
|
|
CMD ["gunicorn", \
|
|
"--bind", "0.0.0.0:5000", \
|
|
"--workers", "1", \
|
|
"--threads", "4", \
|
|
"--timeout", "60", \
|
|
"--graceful-timeout", "20", \
|
|
"--keep-alive", "5", \
|
|
"--worker-tmp-dir", "/tmp", \
|
|
"--access-logfile", "-", \
|
|
"--error-logfile", "-", \
|
|
"app:app"]
|