85 lines
2.0 KiB
JavaScript
85 lines
2.0 KiB
JavaScript
module.exports = {
|
|
apps: [{
|
|
name: 'mission-control',
|
|
script: './node_modules/next/dist/bin/next',
|
|
args: 'start',
|
|
cwd: '/home/devmatrix/mission-control',
|
|
|
|
// Environment
|
|
env: {
|
|
NODE_ENV: 'development',
|
|
PORT: 3000
|
|
},
|
|
env_production: {
|
|
NODE_ENV: 'production',
|
|
PORT: 3000,
|
|
MISSION_CONTROL_DB: '/home/devmatrix/mission-control/data/mission-control.db',
|
|
GITEA_URL: 'https://git.lemonlink.eu',
|
|
BACKUP_DIR: '/mnt/nas/backups/mission-control'
|
|
},
|
|
|
|
// Process management
|
|
instances: 1,
|
|
exec_mode: 'fork',
|
|
|
|
// Logging
|
|
log_file: '/var/log/mission-control/combined.log',
|
|
out_file: '/var/log/mission-control/out.log',
|
|
error_file: '/var/log/mission-control/error.log',
|
|
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
|
|
merge_logs: true,
|
|
|
|
// Auto-restart
|
|
autorestart: true,
|
|
max_restarts: 10,
|
|
min_uptime: '10s',
|
|
|
|
// Memory management
|
|
max_memory_restart: '1G',
|
|
|
|
// Health monitoring
|
|
monitoring: true,
|
|
|
|
// Kill signal
|
|
kill_timeout: 5000,
|
|
listen_timeout: 10000,
|
|
|
|
// Advanced features
|
|
source_map_support: true,
|
|
instance_var: 'INSTANCE_ID',
|
|
|
|
// Watch mode (disabled in production)
|
|
watch: false,
|
|
ignore_watch: ['node_modules', '.next', 'logs'],
|
|
|
|
// Cron restart (optional - daily restart at 3 AM)
|
|
cron_restart: '0 3 * * *',
|
|
|
|
// Error handling
|
|
vizion: false,
|
|
|
|
// Custom metrics
|
|
pmx: false,
|
|
|
|
// Tree kill
|
|
treekill: true,
|
|
|
|
// Wait ready
|
|
wait_ready: true,
|
|
|
|
// Ready timeout
|
|
ready_timeout: 30000
|
|
}],
|
|
|
|
deploy: {
|
|
production: {
|
|
user: 'devmatrix',
|
|
host: '192.168.5.211',
|
|
ref: 'origin/main',
|
|
repo: 'https://git.lemonlink.eu/devmatrix/mission-control.git',
|
|
path: '/home/devmatrix/mission-control',
|
|
'post-deploy': 'npm ci && npm run build && pm2 reload ecosystem.config.js --env production'
|
|
}
|
|
}
|
|
};
|