š„ Domain names with valid SSL for your local docker containers
MIT License
[!INFO] This project was previously called
localhost.tools
.
One time, you may want to run Docker containers locally and interact with them using domain names instead of
127.0.0.1:1234
, for example. Additionally, you may want to use the HTTPS protocol. Thatās what this project
aims to provide.
[!WARNING] This project is under development and may not work as expected. For instance, the current implementation does not support WebSockets, gRPC, or other connection types - only HTTP/HTTPS is supported.
Technically, this project is a simple reverse proxy server. It listens to all incoming requests to domains
like *.indocker.app
and forwards them to the corresponding Docker containers running on your local machine.
To make this work, I've registered the domain indocker.app
and configured it so any subdomain points to your
local machine (127.0.0.1
for IPv4 and ::1
for IPv6):
$ dig +noall +answer -t A foo.indocker.app # IPv4
foo.indocker.app. 7131 IN A 127.0.0.1
$ dig +noall +answer -t AAAA foo.indocker.app # IPv6
foo.indocker.app. 86400 IN AAAA ::1
$ dig +noall +answer foo.bar.baz.indocker.app # any depth
foo.bar.baz.indocker.app. 86400 IN A 127.0.0.1
This eliminates the need for modifying the hosts
file or using additional software to resolve domain names locally.
All you need to do is run the indocker app and configure your Docker containers to be accessible via domain names
using Docker labels.
Hereās an example of how the routing works:
https://foo.indocker.app
foo.indocker.app
resolves to 127.0.0.1
(your local machine)[!INFO] More examples can be found in the examples directory.
To enable HTTPS, Iāve generated a wildcard SSL certificate for the *.indocker.app
domain, signed by
Let's Encrypt. The indocker app uses this certificate to encrypt all incoming requests.
The certificate is automatically renewed periodically, and the app downloads it each time it starts, so you donāt need to worry about managing it.
This is open-sourced software licensed under the MIT License.