From 3412595d79aae4166c65742d2c44befd65cf188b Mon Sep 17 00:00:00 2001 From: jhodgkin Date: Wed, 8 Jul 2026 09:37:17 -0600 Subject: [PATCH] Fix better-sqlite3 Alpine build: force source compilation via env var npm_config_build_from_source=true tells prebuild-install to skip the prebuilt glibc binary download and compile against the container's musl libc instead. The previous attempt (npm rebuild --build-from-source) ran after the glibc binary was already installed and didn't override it. Co-Authored-By: Claude Sonnet 4.6 --- api/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/Dockerfile b/api/Dockerfile index 5484373..3859494 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -5,7 +5,9 @@ RUN apk add --no-cache python3 make g++ WORKDIR /app COPY package*.json ./ -RUN npm ci --omit=dev && npm rebuild better-sqlite3 --build-from-source +# build_from_source tells prebuild-install to compile better-sqlite3 against +# musl (Alpine) instead of downloading a prebuilt glibc binary +RUN npm_config_build_from_source=true npm ci --omit=dev COPY . .