Add one-click deploy script for /opt production setup with PM2.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-12 13:32:06 +08:00
parent 5e95d3af2f
commit b38b821c35
5 changed files with 519 additions and 32 deletions
+10 -5
View File
@@ -1,14 +1,19 @@
/**
* PM2 进程守护配置
* 标准安装路径: /opt/Trading_Studio
* 用法: pm2 start ecosystem.config.js
*/
const path = require("path");
const APP_DIR = __dirname;
module.exports = {
apps: [
{
name: "trading_studio",
script: "app.py",
interpreter: "./venv/bin/python",
cwd: __dirname,
script: path.join(APP_DIR, "app.py"),
interpreter: path.join(APP_DIR, "venv/bin/python"),
cwd: APP_DIR,
instances: 1,
autorestart: true,
watch: false,
@@ -17,8 +22,8 @@ module.exports = {
PYTHONUNBUFFERED: "1",
CUDA_VISIBLE_DEVICES: "0",
},
error_file: "./logs/pm2-error.log",
out_file: "./logs/pm2-out.log",
error_file: path.join(APP_DIR, "logs/pm2-error.log"),
out_file: path.join(APP_DIR, "logs/pm2-out.log"),
log_date_format: "YYYY-MM-DD HH:mm:ss",
merge_logs: true,
},