/**
 * PM2 Ecosystem Configuration Example
 *
 * Copy this file to ecosystem.config.js and customize for your environment.
 * The actual ecosystem.config.js is gitignored to prevent leaking server-specific
 * configuration or secrets.
 *
 * Usage:
 *   pm2 start ecosystem.config.js
 *   pm2 restart amsoil-dlp
 *   pm2 logs amsoil-dlp
 */

module.exports = {
  apps: [
    {
      name: 'amsoil-dlp',
      script: 'node_modules/next/dist/bin/next',
      args: 'start --keepAliveTimeout 60000',
      cwd: '/path/to/amsoil-dlp',
      instances: 1,
      autorestart: true,
      watch: false,
      max_memory_restart: '1G',
      env: {
        NODE_ENV: 'production',
        PORT: 3000,
      },
    },
  ],
};
