Domain name change recommended in Docker release notes
The latest Docker edge version states in its release notes that localhost should no longer be used.
DNS name docker.for.mac.host.internal shoud be used instead of docker.for.mac.localhost (still valid) for host resolution from containers, since since there is an RFC banning the use of subdomains of localhost (See https://tools.ietf.org/html/draft-west-let-localhost-be-localhost-06).
This would mean changing all the domains to drupal.docker.host.internal and xxxxxx.drupal.docker.host.internal if I've understood correctly. Not sure if localhost based domains will ever stop working so it may not be worth worrying about but just noting the issue here for consideration.
On macOS you can use dnsmasq for routing. Since we are using Træfik for routing could it be the shorter xxxxx.internal or xxxxx.docker.internal? this should also work if you edit hosts to xxxxx.internal 127.0.0.1
I've haven't found any official Docker docs on using certain domains, even docker.localhost not documented. I don't see any point to use docker.host.internal, you still have to add it to the hosts file, docker.localhost at least works in Chrome. I know it's not a good way because localhost not designed to have any subdomains. If changing to anything then to something like drupal.loc
Our team at work settled on using *.test. We setup dnsmasq for routing *.test to 127.0.0.1 so there is no hosts file change.