This Ansible role would install a Mastodon instance either directly in the computer or a set of docker containers using docker-compose. You will need to have a reverse proxy pointing then to ports 3000 and 4000.
Check the default/main.yml for used variables and customize. If you don't have secrets already generated, leave them empty and the role will create them and you can pick them up from the application.env.production file created in the Mastodon folder.