// backend/ecosystem.config.cjs
module.exports = {
  apps: [
    {
      name: 'contentmachine-api',
      script: 'src/index.js',
      cwd: '/var/www/contentmachine/backend',
      instances: 2,
      exec_mode: 'cluster',
      watch: false,
      env_production: {
        NODE_ENV: 'production',
        PORT: 4000,
      },
      error_file: 'logs/error.log',
      out_file: 'logs/out.log',
      log_date_format: 'YYYY-MM-DD HH:mm:ss',
      max_memory_restart: '512M',
      restart_delay: 5000,
      exp_backoff_restart_delay: 100,
    }
  ]
};
