| # Base image with Python | |
| FROM python:3.10-slim | |
| # Set environment variables to avoid cache permission issues | |
| ENV TRANSFORMERS_CACHE=/app/cache | |
| ENV HF_HOME=/app/cache | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy your code | |
| COPY . /app | |
| # Install dependencies | |
| RUN pip install --upgrade pip | |
| RUN pip install fastapi uvicorn python-multipart sentence-transformers torch pandas PyMuPDF | |
| # Expose port | |
| EXPOSE 7860 | |
| # Run FastAPI server | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |