How ptlc8/apache-docker-proxy works
Main Components
a) Docker Environment Layer:
• Container labels (show as metadata attached to containers)
• Docker socket connection
b) Config Generator Component:
• Config generator container
• Templates directory
• docker-gen process
• config.toml configuration
• Apache2 template processor
c) HTTP Daemon Layer:
• Apache2 server container
• Generated configuration files
• Static files server
Flow and Relationships
• Docker socket → Config Generator (watching for container events)
• Config Generator → Apache2 Configuration (writing generated configs)
• Apache2 → External Traffic (handling incoming requests)
• Container Labels → Config Generator (input for configuration)
• Environment Variables → Config Generator (global settings)
Key Elements to Highlight
• Blue containers for Docker components
Specific Details
a) Configuration Sources:
• Environment Variables
• TOPDOMAIN
• HTTP_PORT
• HTDOCS_DIRECTORY
• Other env vars...
• Container Labels
• webproxy.subdomain
• webproxy.path
• webproxy.port
• Other labels...
b) Processing Flow:
1. Container Event Detection
2. Label Processing
3. Template Rendering
4. Config Generation
5. Apache2 Reload
Important Notes
• Template mechanism (apache2.tmpl)
• Static file serving capability
• Demonstrate the proxy paths and subdomain routing
• SSL/HTTPS redirect mechanism
• Error page handling