FROM python:3.11-slim # Install system dependencies RUN apt-get update && apt-get install -y \ poppler-utils \ tesseract-ocr \ libgl1-mesa-glx \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Copy requirements first for better caching COPY requirements_hf.txt . RUN pip install --no-cache-dir -r requirements_hf.txt # Copy application files COPY . . # Create environment template RUN if [ ! -f .env ]; then cp .env_template .env; fi # Expose Streamlit port EXPOSE 7860 # Health check HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health # Run the application CMD ["streamlit", "run", "app_hf.py", "--server.port=7860", "--server.address=0.0.0.0"]