Talk to the VPS provider about upgrading your RAM amount. You don’t need swap with enough RAM.
You could look at using a service monitoring utility like monit to automatically restart your container when processes crash but the problem will get worse the more active users you have and there’s a risk of corrupting the database over time.