Spaces:
Build error
Build error
Update Dockerfile
Browse files12345678910111213141516171819FROM python:3.10ARG PIP_NO_CACHE_DIR=1RUN 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/cpuRUN pip install paddlepaddle==2.6.0 -i https://mirror.baidu.com/pypi/simpleRUN pip install transformers pytesseract gradio Pillow paddleocr==2.7.0.3RUN useradd -m -u 1000 userUSER userENV HOME=/home/userWORKDIR $HOME/appCOPY --chown=user . $HOME/appCMD ["python", "app.py"]123456789101112131415161718192021222324252627282930313233343536373839404142FROM python:3.10-slim# Prevent pip from caching downloaded packagesARG PIP_NO_CACHE_DIR=1# Install system dependenciesRUN apt-get update && apt-get install -y \tesseract-ocr \libgl1 \gcc \g++ \libglib2.0-0 \libsm6 \libxext6 \libxrender-dev \&& rm -rf /var/lib/apt/lists/*# Install Python packagesRUN pip install --no-cache-dir numpyRUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpuRUN pip install --no-cache-dir paddlepaddle -i https://pypi.org/simpleRUN pip install --no-cache-dir opencv-python-headlessRUN pip install --no-cache-dir \transformers \pytesseract \gradio \Pillow \paddleocr \pydantic \fastapi# Create a non-root userRUN useradd -m -u 1000 userUSER userENV HOME=/home/userWORKDIR $HOME/app# Copy application filesCOPY --chown=user . $HOME/app# Run the applicationCMD ["python", "app.py"]
Dockerfile+30-7