module.exports = {
  apps: [
    {
      name: 'luckychit-web',
      script: './web-server.js',
      instances: 2, // Run 2 instances for load balancing
      exec_mode: 'cluster',
      autorestart: true,
      watch: false, // Set to true for development
      max_memory_restart: '500M',
      env: {
        NODE_ENV: 'development',
        PORT: 8080
      },
      env_production: {
        NODE_ENV: 'production',
        PORT: 8080
      },
      error_file: './logs/web-err.log',
      out_file: './logs/web-out.log',
      log_file: './logs/web-combined.log',
      time: true,
      merge_logs: true
    }
  ]
};

