/** * PM2 Ecosystem Configuration * Quản lý các process của Sena School Management System */ module.exports = { apps: [ // Main API Server { name: 'sena-api', script: './server.js', instances: 1, // Chạy 1 instance để tận dụng CPU exec_mode: 'cluster', env: { NODE_ENV: 'production', PORT: 10001, }, error_file: './logs/api-error.log', out_file: './logs/api-out.log', log_date_format: 'YYYY-MM-DD HH:mm:ss', merge_logs: true, max_memory_restart: '1G', autorestart: true, watch: false, max_restarts: 10, min_uptime: '10s', } ], };