feat: adiciona configuração do PM2 para gerenciamento de processos

This commit is contained in:
JurTI-BR
2025-12-17 11:44:20 -03:00
parent 8cfcaf3910
commit b13e2775b4
3 changed files with 1433 additions and 41 deletions

29
ecosystem.config.js Normal file
View 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'],
},
],
};