Free, Open Source, Self-Hosted WhatsApp API Gateway
TypeScript apibotgatewayself-hostedwhatsappwhatsapp-apiwhatsapp-automationwhatsapp-botwhatsapp-gatewaywhatsapp-gateway-apiwhatsapp-webwhatsapp-web-api
build(docker): skip install scripts in the production dependency install
Yudhi Armyndharis0ef01990d8f4
diff --git a/Dockerfile b/Dockerfileindex 8b29017cf..3f5a06c90 100644--- a/Dockerfile+++ b/Dockerfile@@ -128,9 +128,9 @@ COPY package*.json ./# Backport upstream whatsapp-web.js#201832 (id._serialized -> id.$1 normalization,# broken by WA Web 2.3000.x ~2026-07-14) into the installed dep at build time.# The patcher self-disables once whatsapp-web.js ships the fix upstream.-# scripts/postinstall.js rides along: `npm ci` below runs the hook, which fails-# when the file is missing. With the patcher present the hook applies it in-# --best-effort mode; the explicit fatal run right after is the real gate.+# scripts/postinstall.js rides along so a bare local `npm ci` keeps working, but the+# --ignore-scripts install below skips the hook here: the explicit fatal run right+# after is the sole (and stricter) applier for the image.COPY scripts/postinstall.js scripts/patch-wwebjs-201832.js scripts/wwebjs-201832.patch scripts/patch-wwebjs-newsletter-preview.js scripts/patch-wwebjs-status.js scripts/patch-wwebjs-ready-sync.js scripts/patch-wwebjs-participant-arity.js scripts/patch-baileys-appstate.js scripts/patch-baileys-newsletter-create.js ./scripts/# Install production dependencies only, then apply the backports. The status patcher runs after@@ -138,7 +138,16 @@ COPY scripts/postinstall.js scripts/patch-wwebjs-201832.js scripts/wwebjs-201832# scripts/dockerfile-patchers.spec.js derives this list from scripts/patch-*.js and fails if a# patcher is added without being copied AND run here — a hand-written list loses one silently, and# the Baileys one shipped in postinstall for a whole release without ever reaching the image.-RUN npm ci --omit=dev \+#+# --ignore-scripts: this stage has no compiler toolchain, and npm still auto-runs+# `node-gyp rebuild` for any package shipping a binding.gyp without its own install+# script (better-sqlite3's major bump ships N-API prebuilds inside the package, so+# its runtime loader picks prebuilds/<platform>-<arch>.node — compiling here would+# fail on the missing python). The other native optionals (cpu-features,+# msgpackr-extract) are optional=true with runtime fallbacks. The patchers that DO+# need to run are the explicit fatal invocations below; baileys' preinstall is only+# a node-version check that the engines field enforces anyway.+RUN npm ci --omit=dev --ignore-scripts \&& node scripts/patch-wwebjs-201832.js \&& node scripts/patch-wwebjs-newsletter-preview.js \&& node scripts/patch-wwebjs-status.js \