From 37cc3a74862f996047b20dc96a834173d6248b9f Mon Sep 17 00:00:00 2001 From: asepharyana Date: Fri, 24 Jul 2026 17:55:37 +0700 Subject: [PATCH] fix: use bun for Next.js server, not node Node.js not available in runtime image. Use bun instead which is copied from frontend-builder stage. Co-Authored-By: Kilo --- scripts/entrypoint.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index 135f85e..c580425 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -50,7 +50,14 @@ WORKER_PID=$! # ── 4. Start Next.js Frontend (port 3000) ── -if [ -f /app/node_modules/.bin/next ]; then +if command -v bun &>/dev/null && [ -f /app/node_modules/.bin/next ]; then + echo "Starting Next.js frontend on port 3000..." + cd /app + NODE_ENV=production RUST_GATEWAY_URL=http://localhost:3001 \ + bun run next start --port 3000 & + NEXT_PID=$! + echo "Next.js frontend started (PID: $NEXT_PID)" +elif command -v node &>/dev/null && [ -f /app/node_modules/.bin/next ]; then echo "Starting Next.js frontend on port 3000..." cd /app NODE_ENV=production RUST_GATEWAY_URL=http://localhost:3001 \ @@ -58,7 +65,7 @@ if [ -f /app/node_modules/.bin/next ]; then NEXT_PID=$! echo "Next.js frontend started (PID: $NEXT_PID)" else - echo "WARNING: Next.js not found, frontend will not be served" + echo "WARNING: Node.js/bun not found, frontend will not be served" NEXT_PID="" fi