-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecosystem.config.js
More file actions
55 lines (55 loc) · 1.42 KB
/
ecosystem.config.js
File metadata and controls
55 lines (55 loc) · 1.42 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
module.exports = {
/**
* Application configuration section
* http://pm2.keymetrics.io/docs/usage/application-declaration/
*/
apps: [
{
name: 'node-api-server',
script: 'npm',
args: 'run start:prod',
error: './logs/error.log',
log_type: 'json',
log_date_format: 'YYYY-MM-DD HH:mm',
// exec_mode: 'cluster',
// instances: 4,
watch: true,
ignore_watch: [
'node_modules'
],
env_production: {
PORT: 3000,
NODE_ENV: 'production',
HOST: '118.24.155.105'
},
// env: {
// PORT: 3000,
// NODE_ENV: 'development',
// HOST: '127.0.0.1',
// COMMON_VARIABLE: true
// },
}
],
/**
* Deployment section
* http://pm2.keymetrics.io/docs/usage/deployment/
*/
deploy: {
production: {
user: 'root',
host: ['118.24.155.105'],
ref: 'origin/master',
repo: 'https://github.com/jweboy/node-RESTful-API-server.git',
path: '/home/www/node-api-server',
ssh_options: 'StrictHostKeyChecking=no',
'pre-setup': 'apt-get install git ; ls -la',
'post-setup': 'ls -la',
'pre-deploy-local': 'echo "This is a local executed command"',
'pre-deploy': 'git fetch && git pull origin master',
'post-deploy': 'yarn install && pm2 startOrRestart ecosystem.config.js',
'env': {
'NODE_ENV': 'production'
}
}
}
}