| FROM python:3.12-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install uv | |
| RUN pip install uv | |
| # Copy dependency files | |
| COPY pyproject.toml ./ | |
| # Install dependencies using uv | |
| RUN uv pip install --system -e . | |
| # Copy application code | |
| COPY . . | |
| # Create necessary directories | |
| RUN mkdir -p ./app/data/uploads ./chroma_db | |
| # Set environment variables | |
| ENV PYTHONUNBUFFERED=1 | |
| # HF Spaces uses port 7860 | |
| EXPOSE 7860 | |
| # Start the application | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] | |