| |
| FROM python:3.10-slim |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| build-essential \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| WORKDIR /app |
|
|
| |
| RUN pip install --no-cache-dir --upgrade pip setuptools wheel \ |
| && pip install --no-cache-dir "Cython<3" |
|
|
| |
| COPY requirements.txt /app/requirements.txt |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY . /app |
|
|
| ENV PORT=7860 PYTHONUNBUFFERED=1 |
| EXPOSE 7860 |
|
|
| |
| CMD ["sh", "-c", "exec gunicorn run:app --workers 2 --threads 8 --timeout 120 --bind 0.0.0.0:${PORT:-7860}"] |