FROM python:3.10 | |
ARG PIP_NO_CACHE_DIR=1 | |
RUN apt-get update \ | |
&& apt-get install -y tesseract-ocr libgl1 \ | |
&& rm -rf /var/lib/apt/lists/* | |
RUN pip install torch==2.1.1 -i https://download.pytorch.org/whl/cpu | |
RUN pip install paddlepaddle==2.6.0 -i https://mirror.baidu.com/pypi/simple | |
RUN pip install transformers pytesseract gradio Pillow paddleocr==2.7.0.3 | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV HOME=/home/user | |
WORKDIR $HOME/app | |
COPY --chown=user . $HOME/app | |
CMD ["python", "app.py"] | |