Add one-click deploy script for /opt production setup with PM2.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+10
-5
@@ -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,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user