Closed Voziv closed 2 years ago
Not currently but it wouldn't be too hard. Dinghy would need a way to configure more than one TLD, then pass it on to the DNS service and resolver file creation code. The HTTP proxy doesn't actually care what the TLD is. So in theory you could even just add entries on other TLDs to /etc/hosts
pointing to the VM and the HTTP proxy would serve them.
In the process of replying with some more information on this issue I figured out a workaround that works great for my own usecase.
I manually make /etc/resolver/<filename>
entries for the TLD's I want to use.
I use the following to start the container:
docker run -d --restart=always \
-v /var/run/docker.sock:/tmp/docker.sock:ro \
-v ~/.dinghy/certs:/etc/nginx/certs \
-p 80:80 -p 443:443 -p 19322:19322/udp \
-e DOMAIN_TLD='#' -e CONTAINER_NAME=http-proxy \
--name http-proxy \
codekitchen/dinghy-http-proxy
DNSMasq treats the #
entry as a wildcard entry.
This does produce a bunch of useless nginx entries, such as web.voziv.#
but nginx doesn't seem to mind it at all. I use docker-compose.yml
and specify my hosts for each container there and those entries come through just fine. So far it seems nginx is serving them all up normally.
Now when I visit both domains I get the nginx proxy default page. http://test.docker http://test.dev
Some other automated options could be adding to dnsmasq.conf
.
In dnsmasq.conf
we could add conf-dir=/etc/dnsmasq.d
and create a file per domain, or a single file with multiple address lines.
Example:
address=/docker/<docker vm ip>
address=/dev/<docker vm ip>
address=/example.com/<docker vm ip>
Not sure how to go about passing in multiple TLD's through environment variables though.
The first solution works really well for me, so I don't need this issue anymore. Feel free to close the issue if you'd like.
Edit: I figured the wildcard bit out by looking at the FreedomBen/dory-dnsmasq - Wildcard TLD
I don't mind creating different
/etc/resolver/<tld>
files myself.Some projects I'm working on use
domain.docker
and others usedomain.dev
, finally another one uses a domain variant of our app. While that domain has DNS values, being able to use the resolver would mean development would work offline without any problems