FROM python:3.11-slim WORKDIR /app # Install system dependencies for PyMuPDF RUN apt-get update && apt-get install -y \ libmupdf-dev \ mupdf-tools \ && rm -rf /var/lib/apt/lists/* # Copy requirements and install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy application files COPY app.py . COPY smolvlm_classifier.py . COPY pdf_to_image.py . # Expose Streamlit port EXPOSE 7860 # Disable torch.compile for HF Spaces compatibility ENV DISABLE_TORCH_COMPILE=1 # Run Streamlit CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableCORS=false", "--server.enableXsrfProtection=false"]