startup: safeguard to install prod deps in prebuilt images if missing; rebuild bcrypt

This commit is contained in:
2025-10-06 18:14:39 +02:00
parent f35674ddbc
commit 7a84130aec

View File

@@ -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