FROM python:3.10-slim ENV DEBIAN_FRONTEND=noninteractive WORKDIR /app # system deps required by opencv/paddle/others RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ git \ wget \ libgl1 \ libglib2.0-0 \ ffmpeg \ && rm -rf /var/lib/apt/lists/* # copy requirements and app COPY requirements.txt /app/requirements.txt COPY app.py /app/app.py # install pip requirements first (torch may come from default index) RUN pip install --upgrade pip setuptools wheel # install paddlepaddle CPU build first (as requested) RUN pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/ || true # install the rest RUN pip install -r /app/requirements.txt # ensure tmp dir exists and writable RUN mkdir -p /tmp/ocr_app && chmod 1777 /tmp/ocr_app EXPOSE 7860 CMD ["python", "app.py"]