-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecosystem.config.js
78 lines (77 loc) · 1.65 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
const defaults = {
apps: {
env: {
NODE_ENV: "development",
NODE_APP_INSTANCE: ""
},
env_production: {
NODE_ENV: "production",
NODE_APP_INSTANCE: ""
},
min_uptime: 10000,
max_restarts: 3,
log_date_format: "DD-MM-YYYY HH:mm:ss"
},
deploy: {
user: "ddml",
host: "206.189.9.70",
ref: "origin/master",
repo: "[email protected]:mishaberezin/mordor.git",
path: "/var/www/mordor",
"post-setup": "ls -la"
}
};
module.exports = {
apps: [
{
name: "api",
script: "app/api.js",
...defaults.apps
},
{
name: "cian_crawler",
script: "app/cian-crawler.js",
max_memory_restart: "300M",
...defaults.apps
},
{
name: "cian_checker",
script: "app/cian-checker.js",
max_memory_restart: "300M",
...defaults.apps
},
{
name: "realty_crawler",
script: "app/realty-crawler.js",
max_memory_restart: "300M",
...defaults.apps
},
{
name: "realty_checker",
script: "app/realty-checker.js",
max_memory_restart: "300M",
...defaults.apps
},
{
name: "digest",
script: "app/digest.js",
...defaults.apps
},
{
name: "report",
script: "app/report.js",
...defaults.apps
}
],
deploy: {
production: {
...defaults.deploy,
"post-deploy":
"pm2 stop all && cp ~/.env .env && rm -fr .tmp && npm ci && pm2 reset all && pm2 startOrRestart ecosystem.config.js --env production"
},
production_fast: {
...defaults.deploy,
"post-deploy": "pm2 startOrRestart ecosystem.config.js --env production"
}
}
};