Spaces:
Running
Running
| # infra/hf_spaces/reranker/Dockerfile | |
| # Bakes cross-encoder/ms-marco-MiniLM-L-6-v2 weights into the image at build time. | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| ENV HF_HOME=/app/model_cache \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 | |
| RUN pip install --no-cache-dir \ | |
| fastapi>=0.115.0 \ | |
| uvicorn[standard]>=0.29.0 \ | |
| sentence-transformers>=3.0.0 | |
| # Bake model weights into this Docker layer. | |
| RUN python -c "\ | |
| from sentence_transformers import CrossEncoder; \ | |
| CrossEncoder('cross-encoder/ms-marco-MiniLM-L-6-v2', cache_folder='/app/model_cache')" | |
| COPY app.py . | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] | |