FROM python:3.11-slim WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ && rm -rf /var/lib/apt/lists/* # Install uv for faster package installation RUN pip install uv # Copy requirements and install dependencies with uv COPY requirements.txt . RUN uv pip install --system -r requirements.txt # Copy the entire application from the current directory COPY . . # Create a writable directory for ChromaDB (required for HF Spaces) RUN mkdir -p /app/chroma_db && chmod 777 /app/chroma_db # Run the application CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]