docker-gen is a general-purpose configuration generator that produces configuration files by applying Go templates to live Docker container metadata. It generates dynamic configuration for reverse proxies, log forwarding, log rotation, and other service files based on real-time container state.
The tool watches Docker container lifecycle events—such as start, stop, and die—and automatically re-renders templates each time a change occurs. It supports multiple template jobs defined in a configuration file, executing them sequentially, and can send Unix signals or run commands after regeneration to reload dependent processes. Container filtering via labels, status, or port exposure ensures only relevant containers participate in template generation.
Beyond reverse proxy configuration, docker-gen automates the creation of Fluentd log forwarding entries and logrotate configuration files derived from container metadata and environment variables. Its template-based approach makes it adaptable to any text-based configuration format, enabling integration with a wide variety of services that need dynamic, container-aware configuration.
The project is written in Go and distributed as a single binary, with templates and generated outputs stored as plain files on disk.