whatsapp-bot/ecosystem.config.cjs
Martin Porwoll 1b0fafda24 fix: add --env-file=.env to PM2 node_args
Node.js doesn't load .env files automatically. Using Node 22's
native --env-file flag instead of adding dotenv dependency.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 14:13:23 +00:00

20 lines
451 B
JavaScript

module.exports = {
apps: [
{
name: 'whatsapp-bot',
script: 'dist/server.js',
node_args: '--env-file=.env',
instances: 1,
exec_mode: 'fork',
autorestart: true,
watch: false,
max_memory_restart: '512M',
env: {
NODE_ENV: 'production',
},
error_file: '/var/log/pm2/whatsapp-bot-error.log',
out_file: '/var/log/pm2/whatsapp-bot-out.log',
time: true,
},
],
}