mirror of
https://github.com/complexcaresolutions/whatsapp-bot.git
synced 2026-03-17 19:44:06 +00:00
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>
20 lines
451 B
JavaScript
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,
|
|
},
|
|
],
|
|
}
|