-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecosystem.config.js
More file actions
72 lines (71 loc) · 2.03 KB
/
Copy pathecosystem.config.js
File metadata and controls
72 lines (71 loc) · 2.03 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
/**
* PM2 Ecosystem Configuration for Digital FTE
*
* Commands:
* pm2 start ecosystem.config.js # Start all processes
* pm2 save # Save process list
* pm2 startup # Generate startup script (run output command with admin)
* pm2 logs # View logs
* pm2 monit # Real-time monitoring
* pm2 restart all # Restart all processes
* pm2 stop all # Stop all processes
*
* Windows Auto-start:
* npm install -g pm2-windows-startup
* pm2-startup install
* pm2 start ecosystem.config.js
* pm2 save
*/
module.exports = {
apps: [
{
name: 'fte-main',
script: 'main.py',
interpreter: 'python',
cwd: __dirname,
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '500M',
env: {
NODE_ENV: 'production',
PYTHONUNBUFFERED: '1',
},
error_file: 'AI_Employee_Vault/Logs/pm2-error.log',
out_file: 'AI_Employee_Vault/Logs/pm2-out.log',
log_file: 'AI_Employee_Vault/Logs/pm2-combined.log',
time: true,
merge_logs: true,
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
// Restart on crash with exponential backoff
restart_delay: 5000,
exp_backoff_restart_delay: 100,
max_restarts: 10,
// Graceful shutdown
kill_timeout: 10000,
wait_ready: true,
listen_timeout: 10000,
},
{
name: 'fte-watchdog',
script: 'watchdog_runner.py',
interpreter: 'python',
cwd: __dirname,
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '200M',
env: {
PYTHONUNBUFFERED: '1',
},
error_file: 'AI_Employee_Vault/Logs/watchdog-error.log',
out_file: 'AI_Employee_Vault/Logs/watchdog-out.log',
time: true,
merge_logs: true,
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
restart_delay: 10000,
max_restarts: 5,
kill_timeout: 5000,
},
],
};