From b51a57ab174b375fc1c9da7d226a83ad3f6b8fc7 Mon Sep 17 00:00:00 2001 From: Plateau Nguyen Date: Thu, 2 Apr 2026 18:34:21 +0700 Subject: [PATCH] fix(docker): resolve @rollup/rollup-linux-arm64-musl missing on Alpine (#647) Added ui/web/.npmrc with supportedArchitectures for musl+glibc/arm64+x64. Updated Dockerfile to use --no-frozen-lockfile so pnpm fetches native rollup binding compatible with Alpine's musl libc. Lockfile still pinned by copy order. --- Dockerfile | 7 +++++-- ui/web/.npmrc | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 ui/web/.npmrc diff --git a/Dockerfile b/Dockerfile index 97853f52..2e3947b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,11 @@ FROM node:22-alpine AS web-builder RUN corepack enable && corepack prepare pnpm@10.28.2 --activate WORKDIR /app -COPY ui/web/package.json ui/web/pnpm-lock.yaml ./ -RUN pnpm install --frozen-lockfile +# Copy .npmrc first so pnpm fetches musl native bindings (needed on Alpine) +COPY ui/web/.npmrc ui/web/package.json ui/web/pnpm-lock.yaml ./ +# Use --no-frozen-lockfile so pnpm can fetch musl native bindings missing from macOS-generated lockfile. +# Lockfile is still copied above to pin versions; .npmrc sets supportedArchitectures for Alpine (musl). +RUN pnpm install --no-frozen-lockfile COPY ui/web/ . RUN pnpm build diff --git a/ui/web/.npmrc b/ui/web/.npmrc new file mode 100644 index 00000000..cfbf5483 --- /dev/null +++ b/ui/web/.npmrc @@ -0,0 +1,5 @@ +# Ensure pnpm fetches native bindings for both glibc and musl (Alpine Docker builds) +supportedArchitectures.cpu[]=arm64 +supportedArchitectures.cpu[]=x64 +supportedArchitectures.libc[]=musl +supportedArchitectures.libc[]=glibc