-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecosystem.config.js
57 lines (56 loc) · 1.75 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: [
{
name: 'frourio-app',
script: 'index.js',
cwd: './server/',
instances: 1,
wait_ready: true,
listen_timeout: 10000,
env: {
NODE_ENV: 'development'
},
env_production: {
NODE_ENV: 'production',
API_DATABASE_URL: process.env.API_DATABASE_URL,
API_JWT_SECRET: process.env.API_JWT_SECRET,
API_USER_ID: process.env.API_USER_ID,
API_USER_PASS: process.env.API_USER_PASS,
API_ORIGIN: process.env.API_ORIGIN,
API_BASE_PATH: process.env.API_BASE_PATH,
API_SERVER_PORT: process.env.API_SERVER_PORT,
API_UPLOAD_DIR: process.env.API_UPLOAD_DIR
}
}
],
deploy: {
production: {
user: process.env.API_DEPLOY_USER,
host: process.env.API_DEPLOY_HOST,
repo: process.env.API_DEPLOY_REPO,
ref: "origin/main",
path: "/opt/apiserver",
ssh_options: ['StrictHostKeyChecking=no'],
'pre-deploy-local': '',
'post-deploy': [
'npm install --production=false',
'npm install --prefix server --production=false',
'npm run build:server',
'npm run migrate:deploy --prefix server',
'npx pm2 startOrRestart ecosystem.config.js --env production'
].join(' && '),
'pre-setup': '',
env: {
NODE_ENV: 'production',
API_DATABASE_URL: process.env.API_DATABASE_URL,
API_JWT_SECRET: process.env.API_JWT_SECRET,
API_USER_ID: process.env.API_USER_ID,
API_USER_PASS: process.env.API_USER_PASS,
API_ORIGIN: process.env.API_ORIGIN,
API_BASE_PATH: process.env.API_BASE_PATH,
API_SERVER_PORT: process.env.API_SERVER_PORT,
API_UPLOAD_DIR: process.env.API_UPLOAD_DIR
}
}
}
}