| 1 | /** |
| 2 | * PM2 Ecosystem Configuration for Siti AI Landing Page - Production |
| 3 | * |
| 4 | * Isolated environment configuration for multi-tenant deployment. |
| 5 | * |
| 6 | * Usage: |
| 7 | * mkdir -p /home/git/apps/web/sitiai/logs |
| 8 | * cd /home/git/apps/web/sitiai |
| 9 | * pm2 start ecosystem.config.js --env production |
| 10 | * pm2 restart siti-web |
| 11 | * pm2 logs siti-web |
| 12 | * |
| 13 | * Keep the port (3034) aligned in three places: |
| 14 | * 1. ../.smb/config.toml ([project] entry, `port`) |
| 15 | * 2. this ecosystem file (PORT) |
| 16 | * 3. nginx/sitiai.com proxy target (if applicable) |
| 17 | */ |
| 18 | |
| 19 | module.exports = { |
| 20 | apps: [ |
| 21 | { |
| 22 | name: "siti-web", |
| 23 | |
| 24 | // Runs from the standalone Next.js server entrypoint. |
| 25 | script: "node", |
| 26 | args: "server.js", |
| 27 | |
| 28 | cwd: "/home/git/apps/web/sitiai", |
| 29 | |
| 30 | instances: 1, |
| 31 | exec_mode: "fork", |
| 32 | |
| 33 | autorestart: true, |
| 34 | watch: false, |
| 35 | max_memory_restart: "1G", |
| 36 | |
| 37 | min_uptime: "10s", |
| 38 | max_restarts: 10, |
| 39 | restart_delay: 4000, |
| 40 | |
| 41 | error_file: "/home/git/apps/web/sitiai/logs/pm2-error.log", |
| 42 | out_file: "/home/git/apps/web/sitiai/logs/pm2-out.log", |
| 43 | log_file: "/home/git/apps/web/sitiai/logs/pm2-combined.log", |
| 44 | time: true, |
| 45 | log_date_format: "YYYY-MM-DD HH:mm:ss Z", |
| 46 | merge_logs: true, |
| 47 | |
| 48 | env_production: { |
| 49 | NODE_ENV: "production", |
| 50 | // The standalone server reads PORT and HOSTNAME from env. |
| 51 | PORT: "3034", |
| 52 | HOSTNAME: "127.0.0.1", |
| 53 | |
| 54 | NEXT_TELEMETRY_DISABLED: "1", |
| 55 | APP_NAME: "siti-web", |
| 56 | APP_ID: "siti-web-prod", |
| 57 | }, |
| 58 | |
| 59 | node_args: [ |
| 60 | "--max-old-space-size=2048", |
| 61 | "--max-http-header-size=16384", |
| 62 | ].join(" "), |
| 63 | |
| 64 | kill_timeout: 5000, |
| 65 | wait_ready: false, |
| 66 | listen_timeout: 10000, |
| 67 | shutdown_with_message: false, |
| 68 | |
| 69 | vizion: false, |
| 70 | }, |
| 71 | ], |
| 72 | }; |