The complete solution for create a automated proxy with nginx for docker containers inspired by docker image jwilder/nginx-proxy e jrcs/letsencrypt-nginx-proxy-companion.
This project is under development, and not all features are ready, check out the roadmap below to know what I'm working on. If you want to help with this project, feel free to ask or submit a pull request.
- Automated create/update of nginx config when container is created/deleted.
- Automated create/renewal of Let's Encrypt certificates using certbot.
- Let's Encrypt / ACME domain validation through challenge.
- Extensible to create custom templates.
- Multiple hosts.
- IPV6 support.
First of all, you must create the proxy. With the command below, you create the proxy easily:
$ docker container run --name proxy -p 80:80 -v /var/run/docker.sock:/app/docker.sock:ro -d italoiz/proxy
There is something very important happening here. You must pass the -v /var/run/docker.sock:/app/docker.sock:ro
flag. This is what will allow node.js to listen for docker container creation events.
$ docker container run --name example -e VIRTUAL_HOST=example.com -d nginx
The proxy will direct traffic from the
example.com
domain to the automatically created container.
MIT © Italo Izaac