From 8062006a216aa8dba049669493c5f106fdcae03e Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Mon, 22 Jun 2026 18:39:06 -0400 Subject: [PATCH] fix(docker): copy scripts/ before npm install; skip postinstall in deploy stage The postinstall hook (scripts/postinstall.mjs) runs during `npm install`, but the Dockerfile only copied package*.json before that step, so the script wasn't present. - Copy scripts/ alongside package*.json in the builder stage. - Add --ignore-scripts to the deploy-stage npm install: flowbite-svelte is a devDependency and won't be installed there, so the postinstall patch is irrelevant and the script file won't be available in that stage anyway. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3dd3da4c..9ea77a70 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,9 @@ FROM node:24-alpine AS builder WORKDIR /app # Install dependencies first for better Docker layer caching. +# scripts/ must be copied before npm install because postinstall.mjs runs during install. COPY package*.json ./ +COPY scripts/ ./scripts/ RUN npm install # Copy the rest of the source code. @@ -47,7 +49,9 @@ COPY --from=builder /app/package.json . COPY --from=builder /app/package-lock.json . # Install only production dependencies. -RUN npm install --omit=dev +# --ignore-scripts skips postinstall (which patches flowbite-svelte dist files); +# flowbite-svelte is a devDependency and won't be installed here anyway. +RUN npm install --omit=dev --ignore-scripts # Copy the runtime env file (non-PUBLIC vars for the Node server). COPY --from=builder /app/.env.runtime .env