Files
lotteryFront/ecosystem.config.cjs
kang 10bee1b857 refactor: update environment configuration and enhance notification handling
- Refactored ecosystem configuration to utilize .env for sensitive variables, improving security and flexibility.
- Replaced direct notification button implementation with a dedicated PlayerNotificationBell component for better code organization.
- Updated various screens to integrate the new notification component and adjusted prefetch settings for links to optimize performance.
- Added new translations for notifications and wallet logs to enhance user experience across multiple languages.
2026-06-01 09:29:02 +08:00

48 lines
1.5 KiB
JavaScript
Raw Permalink 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.
/**
* 玩家端lotteryfront宝塔 PM2 配置
*
* 部署步骤(在服务器项目目录执行):
* 1. 复制 .env.example 为 .env按线上域名填写见下方 env 说明)
* 2. npm ci && npm run build
* 3. 修改下方 cwd 为服务器上的实际路径
* 4. pm2 start ecosystem.config.cjs
* 5. pm2 save && pm2 startup # 开机自启(按 PM2 提示执行)
*
* 宝塔:网站 → Node 项目 → PM2 管理器 → 添加项目 → 选择本文件,或 SSH 执行 pm2 start。
* Nginx反代到 127.0.0.1:3800 即可;/api 由 Next 转发到 LOTTERY_API_UPSTREAM无需单独配。
*/
const path = require("path");
/** 改成服务器上的绝对路径,例如 /www/wwwroot/lottery.yourdomain.com */
const APP_CWD = path.resolve(__dirname);
module.exports = {
apps: [
{
name: "lotteryfront",
cwd: APP_CWD,
script: "node_modules/next/dist/bin/next",
args: "start -p 3800 -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: "3800",
},
// LOTTERY_API_UPSTREAM、NEXT_PUBLIC_* 写在 .env勿在此硬编码 LOTTERY_API_UPSTREAM
env_file: path.join(APP_CWD, ".env"),
},
],
};