This commit is contained in:
hailin 2025-05-18 13:31:23 +08:00
parent ac506110d0
commit 35850bad5f
2 changed files with 12 additions and 3 deletions

View File

@ -9,7 +9,7 @@
"clean": "npm run lint:fix && npm run format:write",
"dev": "next dev -H 0.0.0.0",
"build": "next build",
"start": "next start",
"start": "next start -H 0.0.0.0",
"start:prod": "npm run build && pm2 start npm --name \"chatai-ui\" -- run start",
"lint": "next lint",
"lint:fix": "next lint --fix",

View File

@ -1,5 +1,14 @@
#!/bin/bash
set -e
# 直接启动已构建好的 Next.js app监听 0.0.0.0
exec node node_modules/next/dist/bin/next start -H 0.0.0.0
# --- 等待 Kong 代理接口可用(假设它暴露在 127.0.0.1:8000---
echo "[chatai-ui] Waiting for Kong to be ready at http://localhost:8000/..."
until curl -sSf http://localhost:8000/ > /dev/null; do
echo "[chatai-ui] Kong not ready yet, retrying..."
sleep 1
done
echo "[chatai-ui] Kong is ready."
# --- 切换到项目目录并启动 next.js ---
cd /supabase/chatai-ui
exec npm run start