/** * PM2 ecosystem for the Gmail receipt watcher. * * Loads secrets from the monorepo root `.env` via dotenv in src/config.js. * Override port with WATCHER_PORT (default 3001; production on rpi4 uses 8083). * * pm2 start ecosystem.config.cjs * pm2 save */ module.exports = { apps: [ { name: "gmail-watcher", cwd: __dirname, script: "src/index.js", interpreter: "node", instances: 1, exec_mode: "fork", autorestart: true, max_restarts: 10, restart_delay: 2000, env: { NODE_ENV: "production", WATCHER_PORT: "8083", // Pi has broken global IPv6 (SYN-SENT via link-local); Happy Eyeballs hangs Gmail calls. NODE_OPTIONS: "--dns-result-order=ipv4first --no-network-family-autoselection", }, }, ], };