Just in case anyone finds themselves here still looking for a solution. I've also got a fastapi setup, though I don't need it to stay alive for 10hrs just 5-10 minutes.
The following configuration seems to work for me: