forked from angel-fore/sp-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpm2.json
68 lines (63 loc) · 2.07 KB
/
pm2.json
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
{
/**
* Application configuration section
* http://pm2.keymetrics.io/docs/usage/application-declaration/
*/
"apps": [
// [DEV] client
// 说明,多项目开发只增加次配置即可
{
"name": "super-dev-client",
"script": "./super.build.js",
"max_memory_restart": "1G",
"out_file": "logs/dev/super-dev-client.log",
"error_file": "logs/dev/super-dev-client-error.log",
"env": {
"WEBPACK_BUILD_STAGE": "client",
"WEBPACK_BUILD_ENV": "dev",
"WEBPACK_DEV_SERVER_PORT": "3001"
}
},
// [DEV] server
{
"name": "super-dev-server",
"script": "./super.build.js",
"max_memory_restart": "300M",
"out_file": "logs/dev/super-dev-server.log",
"error_file": "logs/dev/super-dev-server-error.log",
"env": {
"WEBPACK_BUILD_STAGE": "server",
"WEBPACK_BUILD_ENV": "dev",
"WEBPACK_DEV_SERVER_PORT": "3001"
}
},
// [DEV] server run
{
"name": "super-dev-server-run",
"script": "dist/server",
"max_memory_restart": "300M",
"out_file": "logs/dev/super-dev-server-run.log",
"error_file": "logs/dev/super-dev-server-run-error.log",
"watch": [ // 监控变化的目录,一旦变化,自动重启
"dist"
],
"env": {
"SERVER_PORT": "3000",
"DEBUG": "*"
}
},
// [PROD] server run
{
"name": "super-prod-server-run",
"script": "./dist/server",
"max_memory_restart": "300M",
"instances": 1,
"exec_mode": "cluster",
"out_file": "logs/online/super-prod-server-run.log",
"error_file": "logs/online/super-prod-server-run-error.log",
"env": {
"SERVER_PORT": "3000"
}
}
]
}