I've just pushed a change that should speed up the profile loads. There's some additional statistics that are for admins to see, which were being recalculated each time. That's been moved to a daily cron job instead.
This problem was reported a while back by someone else, too. It only occurs on underpowered servers - you'll likely notice other performance problems too. You might be able to tune your postgresql settings using this tool https://pgtune.leopard.in.ua/ to get better performance. I don't know how to do that when postgresql is running in a docker container but it must be possible.