Spaces:
Running
Running
Update Dockerfile
Browse files123456789101112131415161718192021222324252627# Start with a lightweight Python Linux systemFROM python:3.9-slim# Set the working folderWORKDIR /app# Install system libraries# FIX: Replaced 'libgl1-mesa-glx' with 'libgl1' for newer Debian versionsRUN apt-get update && apt-get install -y \libgl1 \libglib2.0-0 \&& rm -rf /var/lib/apt/lists/*# Copy the requirements fileCOPY requirements.txt .# Install Python librariesRUN pip install --no-cache-dir -r requirements.txt# Pre-download the AI model now so we don't wait laterRUN python -c "from paddleocr import PaddleOCR; PaddleOCR(lang='en', use_angle_cls=False)"# Copy the main application codeCOPY main.py .# Start the app on port 7860 (Hugging Face default)CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]12345678910111213141516171819202122FROM python:3.9-slimWORKDIR /app# Install system dependencies# ADDED: libgomp1 (Fixes the crash)RUN apt-get update && apt-get install -y \libgl1 \libglib2.0-0 \libgomp1 \&& rm -rf /var/lib/apt/lists/*COPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txt# Pre-download models# UPDATED: use_textline_orientation=False (Fixes the warning)RUN python -c "from paddleocr import PaddleOCR; PaddleOCR(lang='en', use_textline_orientation=False)"COPY main.py .CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile+6-11