-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathecosystem.config.js
57 lines (44 loc) · 1.6 KB
/
ecosystem.config.js
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
module.exports = {
apps: [
{
// App env
env: {
NODE_ENV: 'production',
},
// auto restart
autorestart: true,
// application name (default to script filename without extension)
name: 'type-safe-nodejs-api',
// time
time: true,
// mode to start your app, can be “cluster” or “fork”, default fork
exec_mode: 'cluster',
//number of app instance to be launched
instances: 1, // Or a number of instances. Default to max available cpu core
// script path relative to pm2 start
script: 'dist/index.js',
// string containing all arguments passed via CLI to script
args: 'start',
// enable watch & restart feature, if a file change in the folder or subfolder, your app will get reloaded
watch: false,
ignore_watch: [
'./node_modules',
'./dist',
'./public',
'./.DS_Store',
'./package.json',
'./yarn.lock',
], // ignore files change
// your app will be restarted if it exceeds the amount of memory specified. human-friendly format : it can be “10M”, “100K”, “2G” and so on…
max_memory_restart: '250M',
// log date format (see log section)
log_date_format: 'DD-MM-YYYY HH:mm:ss.SSS',
// error file path (default to $HOME/.pm2/logs/XXXerr.log)
error_file: './logs/pm2.error.log',
// out file path (default to $HOME/.pm2/logs/XXXout.log)
out_file: './logs/pm2.out.log',
// Set a cron job to restart the app every day at 00:00
cron_restart: '0 0 * * *',
},
],
};