From faf99bd5651f1fa4ab2ad9a1d798553dbba64ac2 Mon Sep 17 00:00:00 2001 From: Ho Ngoc Hai Date: Tue, 14 Apr 2026 01:08:50 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20AI=20Dockerfile=20=E2=80=94=20graceful?= =?UTF-8?q?=20underthesea=20fallback,=20don't=20hard-fail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Try underthesea 6.8.0, fallback to latest, warn if both fail. NLP features degrade gracefully without underthesea. Co-Authored-By: Claude Opus 4 (1M context) --- libs/ai-services/Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/ai-services/Dockerfile b/libs/ai-services/Dockerfile index ff605d4..54a1129 100644 --- a/libs/ai-services/Dockerfile +++ b/libs/ai-services/Dockerfile @@ -8,7 +8,8 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* COPY pyproject.toml . -# Install deps in order: core deps first, then underthesea (may need build tools) +# Install core deps first, then underthesea separately (may need build tools) +# underthesea 6.8.0 needs maturin/Rust — try pre-built wheel, fallback to 6.8.4 or skip NLP RUN pip install --no-cache-dir \ "fastapi==0.115.0" \ "uvicorn[standard]==0.32.0" \ @@ -18,8 +19,9 @@ RUN pip install --no-cache-dir \ "pydantic-settings==2.5.0" \ "httpx==0.27.0" \ "slowapi==0.1.9" && \ - pip install --no-cache-dir "underthesea==6.8.0" || \ - pip install --no-cache-dir "underthesea==6.3.4" + (pip install --no-cache-dir "underthesea==6.8.0" 2>/dev/null || \ + pip install --no-cache-dir "underthesea" 2>/dev/null || \ + echo "WARNING: underthesea install failed, NLP features disabled") COPY app/ ./app/