There are Mastodon hosting companies that offer services like that.
Here’s one example: https://masto.host/
Was looking into this and seems kind of a pain. Too many moving parts and unclear best practices. Matrix imo does self hosting nicely with dendrite. You get two options: monolith or multiple services. Monolith will use in process queues etc instead of having them as separate processes/containers.
It doesn't seem worth the effort unless you have some use case--a particular community you want to cater to, or an organization that wants to control identities on a domain. As an individual, it seems a better choice to go with an established server, and kick in a few bucks on patreon or whatever as needed.
Mastadon seems particularly in need of a mechanism where you can get a hosted domain option, where you can easily just point a DNS record at some large instance and have it work as easily as email does after you point an MX at Google or Microsoft.