# PM2 ecosystem template — fylles ut av install.sh
# (ikke rediger den genererte ecosystem.config.js manuelt; kjør install.sh på nytt)

module.exports = {
  apps: [
    {
      name: '__APP_NAME__',
      script: 'server.js',
      cwd: '__CWD__',

      // Restart policy
      watch: false,
      autorestart: true,
      max_restarts: 10,
      restart_delay: 3000,

      // Environment — production
      env_production: {
        NODE_ENV: 'production',
        PORT: __PORT__,
        SESSION_SECRET: '__SECRET__',
      },

      // Logs
      out_file: '__CWD__/logs/out.log',
      error_file: '__CWD__/logs/error.log',
      merge_logs: true,
      log_date_format: 'YYYY-MM-DD HH:mm:ss',

      kill_timeout: 5000,
    },
  ],
};
