const path = require('path');
require('dotenv').config({ path: path.join(__dirname, '.env') });
require('dotenv').config({ path: path.join(__dirname, '..', '.env') });

module.exports = {
  apps: [
    {
      name: 'deathwatch-server',
      script: '/home/alex/bin/start-dwroller.sh',
      cwd: '/nas/git/dwroller/database',
      watch: false,
      restart_delay: 5000,
      max_restarts: 9999,
      max_memory_restart: '500M',
      instances: 1,
      exec_mode: 'fork',
      error_file: '/home/alex/.pm2/logs/dwroller-error.log',
      out_file: '/home/alex/.pm2/logs/dwroller-out.log',
      merge_logs: true,
      env: {
        NODE_ENV: 'production',
        PORT: 5000
      },
      env_production: {
        NODE_ENV: 'production',
        PORT: 5000
      }
    }
  ]
};
