Auto-generate and reload an nginx reverse proxy config whenever a new container starts with a VIRTUAL_HOST environment variable
Keep log rotation config up to date as containers are added or removed without manual edits
Register containers with etcd or another service discovery system automatically on startup
| nginx-proxy/docker-gen | antoniomika/sish | google/go-cmp | |
|---|---|---|---|
| Stars | 4,625 | 4,626 | 4,630 |
| Language | Go | Go | Go |
| Setup difficulty | moderate | moderate | easy |
| Complexity | 3/5 | 3/5 | 2/5 |
| Audience | ops devops | ops devops | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires access to the Docker socket, run docker-gen as a separate container to avoid exposing the socket to public-facing services.
docker-gen is a Go program that watches your Docker containers and automatically generates text files whenever containers start, stop, or change. You provide a template file written with Go's template syntax, and docker-gen fills it in with live data about your running containers: their names, IP addresses, exposed ports, environment variables, and more. The most common use is generating a reverse proxy configuration. For example, when you start a new web application in a Docker container with an environment variable like VIRTUAL_HOST=example.com, docker-gen can detect that container, rebuild an nginx configuration file that includes that host name, and signal nginx to reload, all without any manual editing. This is how the popular nginx-proxy project works under the hood. Other built-in templates cover centralized logging (sending container log output to fluentd or logstash), log rotation (automatically rotating the JSON log files Docker creates for each container), and service discovery (registering containers with external systems like etcd so other services can find them). There are three ways to run docker-gen: directly on the server, bundled inside the same container as the application it configures, or as a separate standalone container that shares a volume with another container. The separate-container approach is common when you want to keep the Docker socket (which grants broad system access) away from a publicly exposed service. The command accepts a template file and an optional output destination. A -watch flag keeps it running and regenerates files whenever container state changes. The -notify option lets you specify a command or signal to send to a container after each regeneration, which is how nginx gets told to reload its configuration.
A Go program that watches your running Docker containers and regenerates config files from templates whenever containers start, stop, or change, most commonly used to auto-update an nginx reverse proxy without any manual editing.
Mainly Go. The stack also includes Go, Docker, nginx.
License not described in the explanation.
Setup difficulty is rated moderate, with roughly 30min to a first successful run.
Mainly ops devops.
This repo across BitVibe Labs
Verify against the repo before relying on details.