Its a kludge, but in the time being you can also add a docker-compose restart in your server cron every day or few hours. Lemmy restarts are pretty seemless, as the websockets automatically reconnect.
The next release will have websockets removed which should fix some of the stability and memory issues.