From ada1e9c71771f8ce73a0be8b3f27e69f208c451d Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Sun, 22 Feb 2026 22:29:25 +0100 Subject: [PATCH] fix(image-service): force rebuild tfjs-node for container architecture in Dockerfile --- .env | 2 +- apps/image-service/Dockerfile | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.env b/.env index 65e380c..62d6159 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ # Project -IMAGE_TAG=v1.8.11 +IMAGE_TAG=v1.8.12 PROJECT_NAME=at-mintel PROJECT_COLOR=#82ed20 GITEA_TOKEN=ccce002e30fe16a31a6c9d5a414740af2f72a582 diff --git a/apps/image-service/Dockerfile b/apps/image-service/Dockerfile index 8bc1f27..e8f7acc 100644 --- a/apps/image-service/Dockerfile +++ b/apps/image-service/Dockerfile @@ -8,10 +8,13 @@ WORKDIR /app COPY . . # Note: Canvas needs build tools on Debian RUN apt-get update && apt-get install -y python3 make g++ libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev +# Delete the prebuilt binary and force a clean rebuild from source for the correct container architecture RUN pnpm install --frozen-lockfile -# Force tfjs-node to build the native addon from source so it compiles for arm64 (bypassing pnpm quirks) -RUN for f in $(find /app/node_modules/.pnpm -path "*/@tensorflow/tfjs-node/scripts/install.js"); do cd $(dirname $(dirname $f)) && npm run install -- build-addon-from-source; done -RUN pnpm install --frozen-lockfile +RUN for dir in $(find /app/node_modules -type d -path "*/@tensorflow/tfjs-node"); do \ + cd $dir && \ + rm -rf lib/napi-v8/* && \ + npm run install -- build-addon-from-source; \ + done # Generate models explicitly for Docker RUN ls -la packages/image-processor/scripts || true RUN pnpm dlx tsx packages/image-processor/scripts/download-models.ts