-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathecosystem.config.js
More file actions
32 lines (32 loc) · 1.02 KB
/
ecosystem.config.js
File metadata and controls
32 lines (32 loc) · 1.02 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
module.exports = {
apps: [{
name: 'itams',
script: 'server.js',
cwd: process.env.ITAMS_PATH || '/opt/itams',
instances: 1,
exec_mode: 'fork',
// Pre-start script to build the server components
prestart: 'npm run build:server',
env: {
NODE_ENV: 'production',
PORT: process.env.PORT || 3000,
ITAMS_DIST_PATH: process.env.ITAMS_PATH ? `${process.env.ITAMS_PATH}/dist` : '/opt/itams/dist',
REDIS_URL: process.env.REDIS_URL || 'redis://localhost:6379'
},
// Add error handling and restart configuration
max_restarts: 10,
min_uptime: "5m",
restart_delay: 5000,
// Add error file logging
error_file: './logs/err.log',
out_file: './logs/out.log',
log_file: './logs/combined.log',
log_date_format: 'YYYY-MM-DD HH:mm:ss',
// Kill process if it exits unexpectedly
kill_timeout: 3000,
// Watch and restart on file changes (useful for development)
watch: false,
// Disable source maps in production
source_map_support: false
}]
}