-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecosystem.config.js
45 lines (43 loc) · 1.23 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
module.exports = {
apps: [
{
name: 'nest-serve',
script: './dist/src/main.js', // 写本来启动的入口路径就好
autorestart: true,
watch: ["serve"],
ignore_watch: [
// 不⽤监听的⽂件
'node_modules',
'logs',
],
env: {
NODE_ENV: 'development',
},
env_production: {
NODE_ENV: 'production',
HOST: '47.99.93.97',
},
},
],
deploy: {
production: {
key: '~/.ssh/wxfeiang', // 配置后key
user: 'root',
host: ['47.99.93.97'],
port: '22',
ssh_options: 'StrictHostKeyChecking=no',
ref: 'origin/main',
repo: '[email protected]:wxfeiang/nest-serve.git',
path: '/home/nest-serve', // path 指定项目目录
'pre-deploy': 'git fetch --all',
'pre-deploy-local': "echo '正在安装依赖项!。。。。'",
// Post-setup 在 setup 之后执行
'post-setup': 'ls -la',
// 每次 update 都会执行
'pre-deploy-local': "echo '生产环境部署中。。。。。'",
'post-deploy':
'pnpm install && pnpm build && pm2 startOrRestart ecosystem.config.js --env production && pm2 flush ',
},
// 可配置不同env 环境
},
};