Files
lotteryAdmin/ecosystem.config.cjs
kang a550c418e5 refactor(layout, i18n, admin): 优化布局结构与多语言支持
调整 AdminShell 组件的子组件顺序,提升代码可读性。更新 admin-breadcrumb 组件,简化导航标签翻译逻辑,确保多语言支持的一致性。重构 admin-language-switcher 组件,优化语言切换的用户体验,增强界面交互性。更新多语言配置,新增登录界面的副标题,提升用户体验。
2026-05-30 17:46:27 +08:00

48 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* 管理端lotteryadmin宝塔 PM2 配置
*
* 部署步骤(在服务器项目目录执行):
* 1. 复制 .env.example 为 .env按线上域名填写
* 2. npm ci && npm run build
* 3. 修改下方 cwd 为服务器上的实际路径(默认即本文件所在目录)
* 4. pm2 start ecosystem.config.cjs
* 5. pm2 save && pm2 startup
*
* 宝塔PM2 管理器 → 添加项目 → 选择本文件。
* Nginx反代到 127.0.0.1:3801 即可;/api 由 Next 转发到 LOTTERY_API_UPSTREAM无需单独配。
*/
const path = require("path");
/** 改成服务器上的绝对路径,例如 /www/wwwroot/lotteryadmin.tanumo.com */
const APP_CWD = path.resolve(__dirname);
module.exports = {
apps: [
{
name: "lotteryadmin",
cwd: APP_CWD,
script: "node_modules/next/dist/bin/next",
args: "start -p 3801 -H 127.0.0.1",
interpreter: "node",
exec_mode: "fork",
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: "1G",
time: true,
merge_logs: true,
out_file: path.join(APP_CWD, "logs/pm2-out.log"),
error_file: path.join(APP_CWD, "logs/pm2-error.log"),
env: {
NODE_ENV: "production",
PORT: "3801",
},
// LOTTERY_API_UPSTREAM 只写在 .env勿在此硬编码会覆盖 .env 导致 API 502
env_file: path.join(APP_CWD, ".env"),
},
],
};