aizu's Knowledge Base
    • Go to: aizu.my Homepage
    • Recent
    • Tags
    • Register
    • Login

    PM2 - ecosystem file - (interpreter & fork)

    Linux
    1
    1
    19
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      aizu
      last edited by aizu

      ecosystem.config.js

      module.exports = {
        apps: [
          // Next.js Web Dashboard
          {
            name: 'domain-web-5800',
            cwd: './web',
            script: 'npm',
            args: 'start -- -p 5800',
            env: {
              NODE_ENV: 'production',
            },
            instances: 1,
            autorestart: true,
            watch: true,
            exec_mode: 'fork',
            max_memory_restart: '500M',
            error_file: '/var/www/domain/web-error.log',
            out_file: '/var/www/domain/web-out.log',
            merge_logs: true,
            time: true,
          },
      
          // Telegram Bot Service (Express)
          {
            name: 'domain-bot-5801',
            cwd: './bot',
            script: 'src/index.js',
            env: {
              NODE_ENV: 'production',
              PORT: 5801,
            },
            interpreter: '/root/.nvm/versions/node/v20.20.0/bin/node',
            instances: 1,
            autorestart: true,
            watch: true,
            exec_mode: 'fork',
            max_memory_restart: '300M',
            error_file: '/var/www/domain/bot-error.log',
            out_file: '/var/www/domain/bot-out.log',
            merge_logs: true,
            time: true,
          },
        ],
      }
      
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post