Spaces:
Build error
Build error
File size: 942 Bytes
fe28139 71a9e68 fe28139 71a9e68 fe28139 254fb1c fe28139 2db0c5f fe28139 2db0c5f fe28139 2db0c5f 71a9e68 fe28139 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | FROM python:3.10-slim
# Prevent pip from caching downloaded packages
ARG PIP_NO_CACHE_DIR=1
# Install system dependencies
RUN 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 packages
RUN pip install --no-cache-dir numpy
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
RUN pip install --no-cache-dir paddlepaddle -i https://pypi.org/simple
RUN pip install --no-cache-dir opencv-python-headless
RUN pip install --no-cache-dir \
transformers \
pytesseract \
gradio \
Pillow \
paddleocr \
pydantic \
fastapi
# Create a non-root user
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user
WORKDIR $HOME/app
# Copy application files
COPY --chown=user . $HOME/app
# Run the application
CMD ["python", "app.py"] |