-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecosystem.config.cjs
More file actions
41 lines (41 loc) · 985 Bytes
/
ecosystem.config.cjs
File metadata and controls
41 lines (41 loc) · 985 Bytes
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
/**
* PM2 ecosystem config — run the engine 24/7 as a daemon.
*
* Install: npm install -g pm2
*
* Start: pm2 start ecosystem.config.cjs
* Monitor: pm2 monit
* Logs: pm2 logs trading-engine
* Stop: pm2 stop trading-engine
* Restart: pm2 restart trading-engine
*
* Auto-start on reboot:
* pm2 startup
* pm2 save
*/
module.exports = {
apps: [
{
name: "trading-engine",
script: "npx",
args: "tsx src/live.ts -- --no-dashboard --exchanges binance --symbols BTC-USDT,ETH-USDT",
cwd: __dirname,
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: "1G",
env: {
NODE_ENV: "development",
LOG_LEVEL: "info",
},
// Log rotation
log_date_format: "YYYY-MM-DD HH:mm:ss",
error_file: "logs/error.log",
out_file: "logs/output.log",
merge_logs: true,
// Graceful shutdown
kill_timeout: 10000,
listen_timeout: 5000,
},
],
};