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