feat: add production deployment configs

- PM2 cluster mode (2 API workers + 1 Next.js)
- Nginx reverse proxy with SSL, rate limiting, security headers
- Automated backup script with daily/weekly rotation
- PostgreSQL production tuning script (300 connections, 4GB shared_buffers)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Consultoria AS
2026-03-15 23:44:20 +00:00
parent c351b5aeda
commit 3ab6d8d3e9
4 changed files with 205 additions and 20 deletions

View File

@@ -2,35 +2,33 @@ module.exports = {
apps: [
{
name: 'horux-api',
script: 'dist/index.js',
cwd: '/root/Horux/apps/api',
script: 'pnpm',
args: 'dev',
interpreter: 'none',
watch: false,
instances: 2,
exec_mode: 'cluster',
autorestart: true,
restart_delay: 10000,
max_restarts: 3,
max_memory_restart: '1G',
kill_timeout: 5000,
listen_timeout: 10000,
env: {
NODE_ENV: 'development',
PORT: 4000
}
NODE_ENV: 'production',
PORT: 4000,
},
},
{
name: 'horux-web',
script: 'node_modules/.bin/next',
args: 'start',
cwd: '/root/Horux/apps/web',
script: 'pnpm',
args: 'dev',
interpreter: 'none',
watch: false,
instances: 1,
exec_mode: 'fork',
autorestart: true,
restart_delay: 10000,
max_restarts: 3,
max_memory_restart: '512M',
kill_timeout: 5000,
env: {
NODE_ENV: 'development',
PORT: 3000
}
}
]
NODE_ENV: 'production',
PORT: 3000,
},
},
],
};