From 9cf71719ae84b192871e4825183c3ffa4e80d233 Mon Sep 17 00:00:00 2001 From: Ho Ngoc Hai Date: Mon, 13 Apr 2026 15:46:25 +0700 Subject: [PATCH] fix: API pnpm deploy --legacy flag, AI add maturin for underthesea build - API Dockerfile: add --legacy to pnpm deploy (pnpm v10 breaking change) - AI Dockerfile: install Rust toolchain + maturin (required by underthesea 6.8.0) Co-Authored-By: Claude Opus 4 (1M context) --- apps/api/Dockerfile | 2 +- libs/ai-services/Dockerfile | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/api/Dockerfile b/apps/api/Dockerfile index c13bc3e..a1b3feb 100644 --- a/apps/api/Dockerfile +++ b/apps/api/Dockerfile @@ -36,7 +36,7 @@ RUN npx prisma generate \ # Use pnpm deploy to produce a flat, production-only node_modules # This strips devDependencies and hoists only what @goodgo/api needs. -RUN pnpm deploy --filter @goodgo/api --prod /app/pruned +RUN pnpm deploy --legacy --filter @goodgo/api --prod /app/pruned # ---- Production ---- FROM node:22-slim AS production diff --git a/libs/ai-services/Dockerfile b/libs/ai-services/Dockerfile index ce673b5..5dd023a 100644 --- a/libs/ai-services/Dockerfile +++ b/libs/ai-services/Dockerfile @@ -2,13 +2,16 @@ FROM python:3.12-slim WORKDIR /app -# Install system deps for underthesea / numpy + dumb-init for signal handling +# Install system deps for underthesea / numpy + dumb-init + Rust toolchain for maturin RUN apt-get update && \ - apt-get install -y --no-install-recommends gcc g++ dumb-init && \ + apt-get install -y --no-install-recommends gcc g++ dumb-init curl && \ + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal && \ rm -rf /var/lib/apt/lists/* +ENV PATH="/root/.cargo/bin:${PATH}" COPY pyproject.toml . -RUN pip install --no-cache-dir . 2>/dev/null || pip install --no-cache-dir \ +RUN pip install --no-cache-dir maturin && \ + pip install --no-cache-dir . 2>/dev/null || pip install --no-cache-dir \ "fastapi==0.115.0" \ "uvicorn[standard]==0.32.0" \ "xgboost==2.1.0" \