Files
gitlab-instance-0a899031_do…/ecosystem.config.cjs
2026-03-28 17:16:38 -05:00

53 lines
1.9 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.
/**
* PM2在项目根执行 `pm2 start ecosystem.config.cjs` 后 `pm2 save`
* web 使用 scripts/launch.py若缺少 web-console/out 会自动 npm build 再起 uvicorn
*
* 单频道:通常只启一个 youtube.py或 tiktok.py+ web。
* 多频道 Pro每路需要独立 config/youtube.ini + URL_config.ini或独立工作目录
* 请为每路复制一份目录或使用符号链接,再为每个 PM2 app 设置不同的 cwd进程名与控制台 Pro 线路一致(如 youtube2__xxx
* 音频处理链与 GitLab 分支 ffmpegAudioRMFoode 中 douyin_youtube_ffplay 对齐Linux ARM/x86 编码由 config/hardware.env 与硬件探测辅助。
*/
const path = require("path");
const root = __dirname;
const py = process.env.PYTHON || "python3";
module.exports = {
apps: [
{
name: "web",
cwd: root,
script: path.join(root, "scripts", "launch.py"),
interpreter: py,
env: {
HOST: "0.0.0.0",
PORT: process.env.PORT || "8001",
},
},
// —— 单频道直播Linux ARM/x86 通用,二选一或按需启用)——
// {
// name: "youtube",
// cwd: root,
// script: "youtube.py",
// interpreter: py,
// env: { PYTHONUNBUFFERED: "1" },
// },
// {
// name: "tiktok",
// cwd: root,
// script: "tiktok.py",
// interpreter: py,
// env: { PYTHONUNBUFFERED: "1" },
// },
// —— Pro 第二路示例:把 /opt/live/lane2 换成你独立配置目录(内含 config/youtube.ini、URL_config.ini——
// {
// name: "youtube2__lane2",
// cwd: "/opt/live/lane2",
// script: "youtube.py",
// interpreter: py,
// env: { PYTHONUNBUFFERED: "1" },
// },
// Linux: { name: "obs", cwd: root, script: "bash", args: `-lc ${JSON.stringify(path.join(root, "obs.sh"))}` },
// Win: { name: "obs", cwd: root, script: "cmd.exe", args: "/c obs.bat" },
],
};