fix: API copy Prisma from pnpm store, AI drop Rust/maturin approach
Some checks failed
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 10s
Deploy / Build Web Image (push) Failing after 12s
Deploy / Build AI Services Image (push) Failing after 11s
E2E Tests / Playwright E2E (push) Failing after 10s
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 6s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped

- API: copy @prisma/client + .prisma from build stage pnpm store glob
  (pnpm deploy --prod doesn't include generated Prisma client)
- AI: remove Rust toolchain, install underthesea 6.8.0 with fallback to 6.3.4
  (underthesea-core maturin build too complex for Kaniko)

Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ho Ngoc Hai
2026-04-14 00:32:35 +07:00
parent 4418d60c2b
commit 3de953223a
2 changed files with 14 additions and 20 deletions

View File

@@ -2,20 +2,14 @@ FROM python:3.12-slim
WORKDIR /app
# Install system deps for underthesea / numpy + dumb-init + Rust toolchain for maturin
# Install system deps for underthesea / numpy + dumb-init
RUN apt-get update && \
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/* && \
echo 'export PATH="/root/.cargo/bin:$PATH"' >> /etc/profile.d/cargo.sh
ENV PATH="/root/.cargo/bin:${PATH}"
apt-get install -y --no-install-recommends gcc g++ dumb-init && \
rm -rf /var/lib/apt/lists/*
COPY pyproject.toml .
# Install maturin first, then deps with --no-build-isolation for packages needing Rust
RUN /root/.cargo/bin/cargo --version && \
pip install --no-cache-dir maturin setuptools wheel && \
pip install --no-cache-dir --no-build-isolation "underthesea==6.8.0" && \
(pip install --no-cache-dir . 2>/dev/null || pip install --no-cache-dir \
# Install deps in order: core deps first, then underthesea (may need build tools)
RUN pip install --no-cache-dir \
"fastapi==0.115.0" \
"uvicorn[standard]==0.32.0" \
"xgboost==2.1.0" \
@@ -23,7 +17,9 @@ RUN /root/.cargo/bin/cargo --version && \
"pydantic==2.9.0" \
"pydantic-settings==2.5.0" \
"httpx==0.27.0" \
"slowapi==0.1.9")
"slowapi==0.1.9" && \
pip install --no-cache-dir "underthesea==6.8.0" || \
pip install --no-cache-dir "underthesea==6.3.4"
COPY app/ ./app/