[Unit] Description=Wakel AI Next.js Server After=network.target postgresql.service [Service] Type=simple User=root WorkingDirectory=/home/ashraffarid2010/wakelai.com ExecStart=/usr/bin/node server.ts Restart=always RestartSec=5 StandardOutput=journal StandardError=journal Environment=NODE_ENV=production # On SIGUSR2 (or an uncaught exception) Node writes a full diagnostic report # — JS stacks, event-loop state, native stacks — so the watchdog can capture # what the process was doing before it restarts a hung instance. Environment="NODE_OPTIONS=--report-on-signal --report-signal=SIGUSR2 --report-uncaught-exception --report-directory=/var/log/wakelai-reports" [Install] WantedBy=multi-user.target