/**
 * PM2 — configuracao de processo pra rodar em VPS
 *
 * Uso:
 *   pm2 start ecosystem.config.js
 *   pm2 save
 *   pm2 startup
 */

module.exports = {
  apps: [
    {
      name: "imperatriz-bot-{{BOT_SLUG}}",
      script: "./dist/server.js",
      cwd: "/var/www/imperatriz-bot-{{BOT_SLUG}}",
      instances: 1,
      exec_mode: "fork",
      autorestart: true,
      watch: false,
      max_memory_restart: "300M",
      env: {
        NODE_ENV: "production",
        PORT: 3100,
      },
      error_file: "./logs/err.log",
      out_file: "./logs/out.log",
      time: true,
    },
  ],
};
