# Dockerfile for Hugging Face Spaces 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/* # Copy requirements first for caching COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . # Create data directories RUN mkdir -p data/documents data/faiss_index # Set environment variables ENV LLM_PROVIDER=huggingface ENV EMBEDDING_PROVIDER=huggingface ENV HUGGINGFACE_MODEL=mistralai/Mistral-7B-Instruct-v0.2 ENV HUGGINGFACE_EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2 ENV API_HOST=0.0.0.0 ENV API_PORT=8000 # Expose port EXPOSE 8000 # Run the application CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]