diff --git a/deploy/social/README.md b/deploy/social/README.md index 24c052f..cc50684 100644 --- a/deploy/social/README.md +++ b/deploy/social/README.md @@ -34,6 +34,8 @@ pnpm dev - `deploy/social/deploy_82.py` 默认堆 **1536MB** + `nice`/`ionice` + 确保 **2G swap** - 构建失败会回滚上一份 `.next`;构建期间只停 `nomadro.service` - **禁止**并行多次 SSH / 并发跑 deploy;一次发版一条会话 +- **禁止**在 `nomadro.service` 运行中跑 `pnpm install`(会拆坏 `next/.../cookie` → 500) +- 推荐:`pnpm build`(本地)→ `python deploy/social/deploy_local_build_82.py` 生产铁律:[`https://nomadro.cn`](https://nomadro.cn/) / MiroTalk / API / Centrifugo **全部在 `82.157.112.245`**,进房用 `mirotalk.nomadro.cn`。 diff --git a/deploy/social/deploy_local_build_82.py b/deploy/social/deploy_local_build_82.py index 3443838..0bf0ad9 100644 --- a/deploy/social/deploy_local_build_82.py +++ b/deploy/social/deploy_local_build_82.py @@ -109,16 +109,23 @@ fi tar -xzf /tmp/portal_local.tgz --no-same-owner test -f .next/BUILD_ID echo BUILD_ID=$(cat .next/BUILD_ID) -# ensure runtime deps present (centrifuge etc) — no next build +# MUST install while nomadro is stopped — live next + pnpm rewrite = ENOENT / 500 export CI=true +export NODE_OPTIONS='--max-old-space-size=1024' /usr/local/bin/pnpm install --prefer-offline +# sanity: next runtime files must exist +node -e "require('next/package.json')" +test -e node_modules/next/dist/compiled/cookie/index.js \\ + || test -e node_modules/.pnpm/next@*/node_modules/next/dist/compiled/cookie/index.js \\ + || {{ echo 'next cookie missing after install'; exit 4; }} sudo systemctl reset-failed nomadro.service || true sudo systemctl start nomadro.service -sleep 5 +sleep 6 systemctl is-active nomadro.service curl -sS -m 12 -o /dev/null -w 'local=%{{http_code}}\\n' http://127.0.0.1:4003/ || true curl -sS -m 12 -o /dev/null -w 'home=%{{http_code}}\\n' https://nomadro.cn/ || true curl -sS -m 12 -o /dev/null -w 'social=%{{http_code}}\\n' https://nomadro.cn/social || true +curl -sS -m 12 -o /dev/null -w 'date=%{{http_code}}\\n' https://nomadro.cn/social/date || true free -h | head -2 echo DONE_LOCAL_DEPLOY """