Spaces:
Sleeping
Sleeping
| # Use an official Python 3.10 slim image as the base image. | |
| FROM python:3.10-slim | |
| # Install system dependencies | |
| # - tesseract-ocr: for OCR text extraction | |
| # - poppler-utils: for PDF to image conversion (used by pdf2image) | |
| # - gcc: required to compile any C extensions | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| tesseract-ocr \ | |
| poppler-utils \ | |
| gcc \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set the working directory in the container | |
| WORKDIR /app | |
| # Copy the requirements file first (so that dependency installation is cached) | |
| COPY requirements.txt . | |
| # Upgrade pip and install Python dependencies. | |
| RUN pip install --upgrade pip | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of the application code into the container | |
| COPY app.py . | |
| # Expose the default port (7860) used by Gradio | |
| EXPOSE 7860 | |
| # Define the command to run your app | |
| CMD ["python", "app.py"] | |