FROM python:3.11-slim # Install system dependencies for file type detection RUN apt-get update && apt-get install -y \ libmagic1 \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Pre-download the embedding model during build to avoid runtime download issues RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')" COPY . . RUN mkdir -p uploads EXPOSE 7860 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]