Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +6 -11
Dockerfile
CHANGED
|
@@ -1,27 +1,22 @@
|
|
| 1 |
-
# Start with a lightweight Python Linux system
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
# Set the working folder
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Install system
|
| 8 |
-
#
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
libgl1 \
|
| 11 |
libglib2.0-0 \
|
|
|
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
# Copy the requirements file
|
| 15 |
COPY requirements.txt .
|
| 16 |
-
|
| 17 |
-
# Install Python libraries
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
-
# Pre-download
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
-
# Copy the main application code
|
| 24 |
COPY main.py .
|
| 25 |
|
| 26 |
-
# Start the app on port 7860 (Hugging Face default)
|
| 27 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Install system dependencies
|
| 6 |
+
# ADDED: libgomp1 (Fixes the crash)
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
libgl1 \
|
| 9 |
libglib2.0-0 \
|
| 10 |
+
libgomp1 \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
|
|
|
| 13 |
COPY requirements.txt .
|
|
|
|
|
|
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
+
# Pre-download models
|
| 17 |
+
# UPDATED: use_textline_orientation=False (Fixes the warning)
|
| 18 |
+
RUN python -c "from paddleocr import PaddleOCR; PaddleOCR(lang='en', use_textline_orientation=False)"
|
| 19 |
|
|
|
|
| 20 |
COPY main.py .
|
| 21 |
|
|
|
|
| 22 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|