FROM python:3.11-slim # Install system dependencies for PDF processing RUN apt-get update && apt-get install -y --no-install-recommends \ tesseract-ocr \ tesseract-ocr-eng \ poppler-utils \ ghostscript \ libgl1 \ libglib2.0-0 \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Install Python dependencies COPY requirements-cloudrun.txt . RUN pip install --no-cache-dir -r requirements-cloudrun.txt # Copy application code (no worker, redis_queue, or db_manager) COPY cloudrun_service.py . COPY enterprise_pdf_checker.py . COPY pdf_remediation.py . COPY logger_config.py . COPY retry_helper.py . # Cloud Run sets $PORT; gunicorn binds to it # --workers 1 --threads 1: Cloud Run concurrency=1, one request at a time # --timeout 900: allow up to 15 minutes for large PDFs CMD exec gunicorn --bind :$PORT --workers 1 --threads 1 --timeout 900 cloudrun_service:app