feat(deployment): 优化宝塔 PM2 standalone 部署流程并添加一键部署脚本
Some checks failed
lotteryadmin CI / build (push) Has been cancelled

This commit is contained in:
2026-07-07 15:32:19 +08:00
parent 99e644caa1
commit 70250696ea
4 changed files with 30 additions and 6 deletions

View File

@@ -2,8 +2,8 @@
* 管理端lotteryadmin宝塔 PM2 配置
*
* 部署步骤(在服务器项目目录执行):
* 1. 复制 .env.example .env按线上域名填写
* 2. npm ci && npm run build
* 1. 本地 npm run build打包 .next/standalone + .next/static + public 上传服务器
* 2. 服务器:复制 .env.example 为 .env按线上域名填写
* 3. 修改下方 cwd 为服务器上的实际路径(默认即本文件所在目录)
* 4. pm2 start ecosystem.config.cjs
* 5. pm2 save && pm2 startup
@@ -22,8 +22,7 @@ module.exports = {
{
name: "lotteryadmin",
cwd: APP_CWD,
script: "node_modules/next/dist/bin/next",
args: "start -p 3801 -H 127.0.0.1",
script: ".next/standalone/server.js",
interpreter: "node",
exec_mode: "fork",
instances: 1,
@@ -37,6 +36,7 @@ module.exports = {
env: {
NODE_ENV: "production",
HOSTNAME: "0.0.0.0",
PORT: "3801",
},