Spaces:
Running
Running
Commit
·
8adb9d2
1
Parent(s):
a3d53b6
Fix: Dockerfile Updated to support OpenCV headless for huggingface space
Browse files- Dockerfile +3 -5
Dockerfile
CHANGED
|
@@ -7,8 +7,9 @@ RUN apt-get update && apt-get install -y \
|
|
| 7 |
build-essential \
|
| 8 |
libmagic1 \
|
| 9 |
file \
|
| 10 |
-
# OpenCV dependencies
|
| 11 |
-
|
|
|
|
| 12 |
libglib2.0-0 \
|
| 13 |
libsm6 \
|
| 14 |
libxext6 \
|
|
@@ -53,8 +54,5 @@ EXPOSE 7860
|
|
| 53 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 54 |
CMD python -c "import requests; requests.get('http://localhost:7860/api/health', timeout=5)" || exit 1
|
| 55 |
|
| 56 |
-
# Download PaddleOCR models during build (optional, but speeds up first run)
|
| 57 |
-
RUN python -c "from paddleocr import PaddleOCR; PaddleOCR(use_angle_cls=True, lang='en', use_gpu=False, show_log=False)" || true
|
| 58 |
-
|
| 59 |
# Start application with optimized settings for Hugging Face Spaces
|
| 60 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1", "--timeout-keep-alive", "120"]
|
|
|
|
| 7 |
build-essential \
|
| 8 |
libmagic1 \
|
| 9 |
file \
|
| 10 |
+
# OpenCV dependencies for Debian 12
|
| 11 |
+
libglx-mesa0 \
|
| 12 |
+
libgl1 \
|
| 13 |
libglib2.0-0 \
|
| 14 |
libsm6 \
|
| 15 |
libxext6 \
|
|
|
|
| 54 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 55 |
CMD python -c "import requests; requests.get('http://localhost:7860/api/health', timeout=5)" || exit 1
|
| 56 |
|
|
|
|
|
|
|
|
|
|
| 57 |
# Start application with optimized settings for Hugging Face Spaces
|
| 58 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1", "--timeout-keep-alive", "120"]
|