FROM python:3.12-slim # 2. Set working directory WORKDIR /app # 3. Install system dependencies RUN apt-get update && apt-get install -y \ build-essential \ git \ poppler-utils \ tesseract-ocr \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* RUN mkdir -p /home/user/huggingface && chmod -R 777 /home/user ENV HF_HOME=/home/user/huggingface ENV TRANSFORMERS_CACHE=/home/user/huggingface/transformers # 5. Copy requirements COPY requirements.txt . # 6. Install dependencies RUN pip install --no-cache-dir -r requirements.txt # 7. Copy the app code COPY . . # 8. Expose Gradio default port EXPOSE 7860 # 9. Run the Gradio app CMD ["python", "app.py"]