Spaces:
Sleeping
Sleeping
| FROM python:3.10-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PIP_NO_CACHE_DIR=1 | |
| WORKDIR /app | |
| # System deps (FAISS / torch runtime deps) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git \ | |
| libgomp1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Python deps | |
| COPY requirements.txt . | |
| RUN pip install --upgrade pip && pip install -r requirements.txt | |
| # Copy app code + assets (faiss.index + metadata) | |
| COPY . . | |
| # Hugging Face Spaces uses PORT env var sometimes; default to 7860 | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| # Start FastAPI | |
| CMD ["bash", "-lc", "uvicorn app:app --host 0.0.0.0 --port ${PORT}"] | |