-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathecosystem.config.cjs
More file actions
147 lines (144 loc) · 3.82 KB
/
Copy pathecosystem.config.cjs
File metadata and controls
147 lines (144 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
const path = require('path');
const repoRoot = __dirname;
const logsDir = path.join(repoRoot, 'logs');
/**
* PM2 生态配置文件
* 用于管理 Sentra Agent 主进程
*/
module.exports = {
apps: [
{
name: 'sentra-agent',
script: './dist/Main.js',
interpreter: 'node',
cwd: repoRoot,
instances: 1,
exec_mode: 'fork',
windowsHide: true,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'production',
// Force color output for chalk/colorette under PM2 non-TTY
FORCE_COLOR: '3',
TERM: 'xterm-256color',
COLORTERM: 'truecolor',
},
env_production: {
NODE_ENV: 'production',
FORCE_COLOR: '3',
TERM: 'xterm-256color',
COLORTERM: 'truecolor',
},
env_development: {
NODE_ENV: 'development',
FORCE_COLOR: '3',
TERM: 'xterm-256color',
COLORTERM: 'truecolor',
},
error_file: path.join(logsDir, 'pm2-error.log'),
out_file: path.join(logsDir, 'pm2-out.log'),
merge_logs: true,
min_uptime: '10s',
max_restarts: 10,
restart_delay: 4000,
kill_timeout: 5000,
wait_ready: false,
listen_timeout: 3000,
instance_var: 'INSTANCE_ID',
// Do not let PM2 add timestamps; the app already prints time
// time: false (unset),
append_env_to_name: false,
},
{
name: 'sentra-emo',
script: 'run.py',
interpreter: 'python',
cwd: path.join(repoRoot, 'sentra-emo'),
instances: 1,
exec_mode: 'fork',
windowsHide: true,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
FORCE_COLOR: '3',
TERM: 'xterm-256color',
COLORTERM: 'truecolor',
PYTHONUNBUFFERED: '1',
UVICORN_RELOAD: '0',
},
env_production: {
FORCE_COLOR: '3',
TERM: 'xterm-256color',
COLORTERM: 'truecolor',
PYTHONUNBUFFERED: '1',
UVICORN_RELOAD: '0',
},
env_development: {
FORCE_COLOR: '3',
TERM: 'xterm-256color',
COLORTERM: 'truecolor',
PYTHONUNBUFFERED: '1',
UVICORN_RELOAD: '1',
},
error_file: path.join(logsDir, 'pm2-emo-error.log'),
out_file: path.join(logsDir, 'pm2-emo-out.log'),
merge_logs: true,
min_uptime: '10s',
max_restarts: 10,
restart_delay: 4000,
kill_timeout: 5000,
wait_ready: false,
listen_timeout: 3000,
append_env_to_name: false,
},
{
name: 'sentra-napcat',
script: './dist/src/main.js',
interpreter: 'node',
cwd: path.join(repoRoot, 'sentra-adapter', 'napcat'),
instances: 1,
exec_mode: 'fork',
windowsHide: true,
autorestart: true,
watch: false,
max_memory_restart: '512M',
env: {
NODE_ENV: 'production',
FORCE_COLOR: '3',
TERM: 'xterm-256color',
COLORTERM: 'truecolor',
NAPCAT_MODE: 'reverse',
ENABLE_TEST_PLUGIN: 'true',
},
env_production: {
NODE_ENV: 'production',
FORCE_COLOR: '3',
TERM: 'xterm-256color',
COLORTERM: 'truecolor',
NAPCAT_MODE: 'reverse',
ENABLE_TEST_PLUGIN: 'true',
},
env_development: {
NODE_ENV: 'development',
FORCE_COLOR: '3',
TERM: 'xterm-256color',
COLORTERM: 'truecolor',
NAPCAT_MODE: 'reverse',
ENABLE_TEST_PLUGIN: 'true',
},
error_file: path.join(logsDir, 'pm2-napcat-error.log'),
out_file: path.join(logsDir, 'pm2-napcat-out.log'),
merge_logs: true,
min_uptime: '10s',
max_restarts: 10,
restart_delay: 4000,
kill_timeout: 5000,
wait_ready: false,
listen_timeout: 3000,
append_env_to_name: false,
}
]
};