In the source code of LemmyNet/lemmy there is a docker-compose file for setting up multiple instances trough docker that can federate with each other. That is a better practice then federating with other pruduction instances.
https://github.com/LemmyNet/lemmy/blob/main/docker/federation/docker-compose.yml