Have you tried any containers until now?
You can try this one:
https://hub.docker.com/r/satishweb/doh-server
I do not know the project and it should be inspected before usage but it seems legit on the surface
You can see the variables that can be used for the container in this docker-compose.yml example or in the docker hub page:
https://github.com/0x49b/dockerfiles/bl ... ompose.yml
The sources of the project are at:
https://github.com/satishweb/docker-doh
Let me know if it's any good for you.
Also, you can use the MT as your next hop DNS.
... That is if I got you right.
Or you can try to peek at:
https://wiki.archlinux.org/title/DNS_over_HTTPS_servers
and see what software might meet your needs.
They made some fixes to DNS in 7.7, so maybe that might help.
There is
https://hub.docker.com/r/klutchell/unbound container and it's pretty lightweight. You'd have to follow all the instruction to enable containers, and then use the container's IP address as the DNS address. You won't need any mount/env for this container if all you want is a local resolver... But to enable DOH upstream, or any "custom" configuration, you should use a mount for "/etc/unbound" to some local path on the mikrotik so the configuration persist if you remove/update the container image. All possible, but not for the faint of heart, since it's quite a few steps I'm summarizing here.
Ya I'm on 7.7 already and DOH client is still very unstable. Maybe it's specific to nextdns but whatever it is it is an issue. I just followed the instructions to enable containers, now on to step 2.