module.exports = { apps: [{ name: 'app-padel-api', script: './dist/index.js', instances: 'max', exec_mode: 'cluster', env: { NODE_ENV: 'production', PORT: 3000 }, log_file: './logs/combined.log', out_file: './logs/out.log', error_file: './logs/error.log', log_date_format: 'YYYY-MM-DD HH:mm:ss Z', merge_logs: true, max_memory_restart: '1G', restart_delay: 3000, max_restarts: 5, min_uptime: '10s', watch: false, // Configuración para logs log_rotate: true, log_rotate_interval: '1d', log_rotate_keep: 7, // Configuración de monitoreo monitor: true, // Auto-restart en caso de fallo autorestart: true, // No reiniciar si falla muy rápido exp_backoff_restart_delay: 100, // Kill timeout kill_timeout: 5000, // Listen timeout listen_timeout: 10000, // Configuración de entorno por defecto env_development: { NODE_ENV: 'development', PORT: 3000, watch: true, ignore_watch: ['node_modules', 'logs', '.git'] }, env_production: { NODE_ENV: 'production', PORT: 3000 }, // Configuración de PM2 Plus (opcional) // pm2: true, // pm2_env_name: 'production' }] };