feat: adiciona configuração do PM2 para gerenciamento de processos
This commit is contained in:
29
ecosystem.config.js
Normal file
29
ecosystem.config.js
Normal file
@@ -0,0 +1,29 @@
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'portaljuru-api',
|
||||
script: 'dist/main.js',
|
||||
instances: 1,
|
||||
exec_mode: 'fork',
|
||||
interpreter: 'node',
|
||||
interpreter_args: '-r newrelic',
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
TZ: 'America/Sao_Paulo',
|
||||
},
|
||||
error_file: './logs/pm2-error.log',
|
||||
out_file: './logs/pm2-out.log',
|
||||
log_file: './logs/pm2-combined.log',
|
||||
time: true,
|
||||
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
|
||||
merge_logs: true,
|
||||
autorestart: true,
|
||||
max_restarts: 10,
|
||||
min_uptime: '10s',
|
||||
max_memory_restart: '1G',
|
||||
watch: false,
|
||||
ignore_watch: ['node_modules', 'logs', 'dist'],
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
1428
package-lock.json
generated
1428
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
17
package.json
17
package.json
@@ -12,7 +12,14 @@
|
||||
"start": "nest start",
|
||||
"start:dev": "nest start --watch",
|
||||
"start:debug": "nest start --debug --watch",
|
||||
"start:prod": "node dist/main",
|
||||
"start:prod": "node -r newrelic dist/main",
|
||||
"pm2:start": "pm2 start ecosystem.config.js",
|
||||
"pm2:stop": "pm2 stop portaljuru-api",
|
||||
"pm2:restart": "pm2 restart portaljuru-api",
|
||||
"pm2:delete": "pm2 delete portaljuru-api",
|
||||
"pm2:logs": "pm2 logs portaljuru-api",
|
||||
"pm2:monit": "pm2 monit",
|
||||
"pm2:status": "pm2 status",
|
||||
"test": "jest",
|
||||
"test:watch": "jest --watch",
|
||||
"test:cov": "jest --coverage",
|
||||
@@ -57,6 +64,7 @@
|
||||
"md5": "^2.3.0",
|
||||
"md5-typescript": "^1.0.5",
|
||||
"multer": "^1.4.5-lts.2",
|
||||
"newrelic": "^13.8.1",
|
||||
"oracledb": "^6.8.0",
|
||||
"passport": "^0.7.0",
|
||||
"passport-http-bearer": "^1.0.1",
|
||||
@@ -92,7 +100,8 @@
|
||||
"ts-loader": "^9.5.2",
|
||||
"ts-node": "^10.9.2",
|
||||
"tsconfig-paths": "^3.9.0",
|
||||
"typescript": "^5.8.2"
|
||||
"typescript": "^5.8.2",
|
||||
"pm2": "^5.3.0"
|
||||
},
|
||||
"jest": {
|
||||
"moduleFileExtensions": [
|
||||
@@ -116,6 +125,8 @@
|
||||
"transformIgnorePatterns": [
|
||||
"node_modules/(?!(typeorm|@nestjs)/)"
|
||||
],
|
||||
"setupFilesAfterEnv": ["../jest.setup.js"]
|
||||
"setupFilesAfterEnv": [
|
||||
"../jest.setup.js"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user