# Use the official Python image FROM python:3.10-slim # Set the working directory WORKDIR /app # Install system dependencies (Poppler for PDF, libgl1 for OpenCV) RUN apt-get update && apt-get install -y \ poppler-utils \ libgl1 \ libglib2.0-0 \ git \ && rm -rf /var/lib/apt/lists/* # Copy requirements COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt \ fastapi uvicorn python-multipart sse-starlette # Copy the rest of the application COPY . . # Create directory for models RUN mkdir -p models # Expose port 7860 (Hugging Face Spaces default port) EXPOSE 7860 # Run Streamlit by default on port 7860 CMD ["streamlit", "run", "webui.py", "--server.port=7860", "--server.address=0.0.0.0"]