@pier you got it exactly! In Node our docs actually link to this repo for an example in Node/TS/Remix where this file indeed calls process.exit(0).
process.exit(0)
And yes the restart policy should be on-fail (the default for new V2 apps) as explained here:
on-fail