| FROM python:3.11-slim |
|
|
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| gcc \ |
| g++ \ |
| git \ |
| curl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY requirements.txt . |
|
|
| |
| RUN pip install --no-cache-dir --upgrade pip && \ |
| pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY app.py . |
| COPY index.html . |
|
|
| |
| RUN mkdir -p /app/model_cache |
|
|
| |
| ENV TRANSFORMERS_CACHE=/app/model_cache |
| ENV HF_HOME=/app/model_cache |
| ENV PYTHONUNBUFFERED=1 |
| ENV PORT=7860 |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "300", "--workers", "1", "--threads", "2", "app:app"] |