Spaces:
Sleeping
Sleeping
| FROM python:3.10-slim | |
| WORKDIR /app | |
| # System deps for faiss and sentence-transformers | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential libgomp1 && rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Pre-download the embedding model so first request is fast | |
| RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('BAAI/bge-small-en-v1.5')" | |
| COPY . . | |
| RUN useradd -m -u 1000 appuser && chown -R appuser /app | |
| USER appuser | |
| EXPOSE 7860 | |
| ENV PYTHONUNBUFFERED=1 | |
| CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "1", "--timeout", "180", "--keep-alive", "5", "app:app"] |