You’ll have to do some reading, but here’s some (almost) turnkey repos for all the pieces you need to host Lemmy (and other things) in docker.
I use Traefik instead of nginx to do load balancing / edge routing / reverse proxy / SSL termination (and automatic generation via LetsEncrypt - it’s proven to be bulletproof in a good few production setups.