# nginx-proxy/docker-gen

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/nginx-proxy-docker-gen).**

4,615 stars · 616 forks · Go · mit

## Links

- GitHub: https://github.com/nginx-proxy/docker-gen
- awesome-repositories: https://awesome-repositories.com/repository/nginx-proxy-docker-gen.md

## Topics

`docker` `go`

## Description

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.

## Tags

### DevOps & Infrastructure

- [Container Event Driven Template Engines](https://awesome-repositories.com/f/devops-infrastructure/container-configuration-templates/container-event-driven-template-engines.md) — Automatically regenerates container configuration files in response to container lifecycle events.
- [Live Container Metadata Renderers](https://awesome-repositories.com/f/devops-infrastructure/container-image-templates/metadata-templates/live-container-metadata-renderers.md) — Applies Go templates to live Docker container metadata to produce dynamic configuration files for various services. ([source](https://github.com/nginx-proxy/docker-gen#readme))
- [Container Metadata Configuration Generators](https://awesome-repositories.com/f/devops-infrastructure/container-orchestration/container-runtimes/runtime-configuration-interfaces/docker-socket-orchestrators/docker-target-configurators/container-metadata-configuration-generators.md) — Generates configuration files from live Docker container metadata using user-defined templates.
- [Container Lifecycle Triggered File Regenerations](https://awesome-repositories.com/f/devops-infrastructure/event-driven-pipelines/container-lifecycle-triggered-file-regenerations.md) — Monitors Docker container lifecycle events to automatically re-render template files.
- [Event-Driven Triggers](https://awesome-repositories.com/f/devops-infrastructure/event-driven-triggers.md) — Monitors container lifecycle events to automatically regenerate configuration and trigger external commands.
- [Reverse Proxy Configurations](https://awesome-repositories.com/f/devops-infrastructure/reverse-proxy-configurations.md) — Generates reverse proxy configuration files from container environment variables mapping virtual hosts to endpoints. ([source](https://github.com/nginx-proxy/docker-gen/blob/main/templates/nginx.tmpl))
- [Dynamic Reverse Proxy Config Generators](https://awesome-repositories.com/f/devops-infrastructure/reverse-proxy-configurations/dynamic-reverse-proxy-config-generators.md) — Automatically renders reverse proxy configuration files by mapping container environment variables to virtual host endpoints.
- [Container Selection Filters](https://awesome-repositories.com/f/devops-infrastructure/container-filtering-policies/container-context-filtering/container-selection-filters.md) — Filters containers based on labels, status, or port exposure to selectively include them in template generation. ([source](https://github.com/nginx-proxy/docker-gen/blob/main/README.md))
- [Label-Based Selection](https://awesome-repositories.com/f/devops-infrastructure/label-based-selection.md) — Filters containers by Docker labels, status, or port exposure to selectively include them in template generation.

### Content Management & Publishing

- [Template-Driven Generation Engines](https://awesome-repositories.com/f/content-management-publishing/template-driven-generation-engines.md) — Automatically re-renders templates by monitoring Docker container lifecycle events. ([source](https://github.com/nginx-proxy/docker-gen/blob/main/README.md))

### Development Tools & Productivity

- [Go Template Rendering](https://awesome-repositories.com/f/development-tools-productivity/data-transformation/template-helpers/go-template-rendering.md) — Applies Go text/template engine to live container metadata for dynamic configuration generation.
- [Logrotate](https://awesome-repositories.com/f/development-tools-productivity/configuration-generators/logrotate.md) — Generates logrotate configuration files from container metadata for automated log rotation. ([source](https://github.com/nginx-proxy/docker-gen/blob/main/templates/logrotate.tmpl))
- [Sequential Multi-Job Template Executors](https://awesome-repositories.com/f/development-tools-productivity/configuration-templating/template-execution-controls/sequential-multi-job-template-executors.md) — Defines multiple template jobs in a configuration file and executes them sequentially for automated configuration generation. ([source](https://github.com/nginx-proxy/docker-gen#readme))
- [Log Rotation Config Generators](https://awesome-repositories.com/f/development-tools-productivity/project-configuration/automated-config-generation/log-rotation-config-generators.md) — Automatically generates logrotate configuration files from container metadata for log rotation.

### Software Engineering & Architecture

- [Multiple Template Job Pipelines](https://awesome-repositories.com/f/software-engineering-architecture/configuration-templates/multiple-template-job-pipelines.md) — Generates dynamic configuration by executing a pipeline of template jobs defined in a single configuration file.

### System Administration & Monitoring

- [Log Rotation Configuration Generators](https://awesome-repositories.com/f/system-administration-monitoring/log-rotation-utilities/log-rotation-configuration-generators.md) — Produces logrotate configuration files based on container metadata for automated log rotation.
- [Log Forwarders](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/observability-platforms/log-management-systems/log-forwarders.md) — Generates configuration entries to tail and forward container logs to centralized aggregation systems.
- [Log Forwarder Configuration Generators](https://awesome-repositories.com/f/system-administration-monitoring/monitoring-and-observability/observability-platforms/log-management-systems/log-forwarders/log-forwarder-configuration-generators.md) — Generates Fluentd configuration entries to tail and forward container logs to centralized systems. ([source](https://github.com/nginx-proxy/docker-gen/blob/main/templates/fluentd.conf.tmpl))
