Ensure pnpm install before low-mem portal build on 2C/4G.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Eric 2026-11-01 23:52:41 +08:00
parent fb703c8b85
commit 8b4c3c6a4f

View File

@ -188,11 +188,16 @@ trap cleanup EXIT
sudo systemctl stop nomadro.service || true
sudo chown -R ubuntu:ubuntu "$APP"
# keep previous .next as fallback until new build succeeds
if [ -d "$APP/.next" ]; then
if [ -d "$APP/.next" ] && [ -f "$APP/.next/BUILD_ID" ]; then
rm -rf /tmp/nomadro.next.bak
mv "$APP/.next" /tmp/nomadro.next.bak
else
rm -rf "$APP/.next"
fi
# sync deps (e.g. centrifuge) without ballooning memory
/usr/local/bin/pnpm install --prefer-offline
export NODE_OPTIONS="--max-old-space-size=$HEAP"
export NEXT_TELEMETRY_DISABLED=1
export UV_THREADPOOL_SIZE=2