You would probably want to wrap it with nginx outside of docker-compose; attaching Certbot to it is thankfully very pleasant (https://www.digitalocean.com/community/tutorials/how-to-secu...).
To integrate with SendGrid, you'd set the app.ini (https://docs.gitea.io/en-us/config-cheat-sheet/) to point at SendGrid's SMTP relay (https://sendgrid.com/docs/API_Reference/SMTP_API/getting_sta...).
E.g. I add a label to my Gitea container to say "Serve this from git.mydomain.com", and Traefik will start redirecting requests and automatically configure a Let's Encrypt cert.
Basically you have all of your containers join the Docker network that your Traefik container is running on. Each container needs to expose a port (but not bind to the parent). The Traefik container will bind to port 80 on the parent. That guide should explain everything.
Let me know if you have any other questions or get stuck, I'd be happy to try and help!
I have been using it for about a year and recently put it on github, because I found it useful enough to share.
You an find it here https://github.com/chaosbunker/dockerbunker
Maybe not exactly what you are looking for, since I am not familiar with the discourse installer, but maybe interesting for someone? I’m happy about some feedback, since I never actively shared this until now.