-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathecosystem.config.js
More file actions
69 lines (60 loc) · 1.62 KB
/
ecosystem.config.js
File metadata and controls
69 lines (60 loc) · 1.62 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
module.exports = {
apps: [{
name: 'coce',
script: 'app.js',
instances: 'max', // Use all CPU cores
exec_mode: 'cluster',
// Environment variables
env: {
NODE_ENV: 'production',
LOG_LEVEL: 'info',
LOG_FILE: '/var/log/coce/coce.log',
},
// Development environment
env_development: {
NODE_ENV: 'development',
LOG_LEVEL: 'debug',
watch: true,
ignore_watch: ['node_modules', 'logs', 'test'],
},
// Logging configuration
log_file: '/var/log/coce/combined.log',
out_file: '/var/log/coce/out.log',
error_file: '/var/log/coce/error.log',
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
// Process management
max_memory_restart: '500M',
log_type: 'json',
merge_logs: true,
min_uptime: '10s',
max_restarts: 10,
restart_delay: 4000,
// Health monitoring
health_check_grace_period: 3000,
health_check_fatal_exceptions: true,
// Performance monitoring
pmx: true,
instance_var: 'INSTANCE_ID',
source_map_support: false,
// Graceful shutdown
kill_timeout: 5000,
listen_timeout: 3000,
// Watch options
watch_options: {
followSymlinks: false,
usePolling: false,
},
}],
// Deployment configuration
deploy: {
production: {
user: 'deploy',
host: ['server1.example.com', 'server2.example.com'],
ref: 'origin/master',
repo: 'git@github.com:username/coce.git',
path: '/var/www/coce',
'post-deploy': 'npm install && pm2 reload ecosystem.config.js --env production',
'pre-setup': 'apt update && apt install git -y',
},
},
};