From 7a84130aecd1cf445b29085ce9ab2956a5cba73f Mon Sep 17 00:00:00 2001 From: elpatron Date: Mon, 6 Oct 2025 18:14:39 +0200 Subject: [PATCH] startup: safeguard to install prod deps in prebuilt images if missing; rebuild bcrypt --- start.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/start.sh b/start.sh index 32cf6a8..60dd82e 100644 --- a/start.sh +++ b/start.sh @@ -10,5 +10,12 @@ mkdir -p /app/.storage/cancellation-tokens # Change ownership to nextjs user chown -R nextjs:nodejs /app/.storage +# Ensure runtime dependencies exist (for prebuilt images) +if [ ! -d "/app/node_modules/hono" ]; then + echo "[startup] Installing runtime dependencies (prebuilt safeguard)..." + pnpm install --frozen-lockfile --prod --ignore-scripts=false || pnpm install --prod || true + pnpm rebuild bcrypt || true +fi + # Start the application as nextjs user exec su-exec nextjs node server-dist/index.js