Auto Route Configuration
Automatically create routes from image names that contain domains.
Configuration
[auto_route]
enabled = true
Options
| Option | Type | Default | Description |
|---|---|---|---|
enabled |
bool | false |
Enable automatic route creation |
How It Works
When auto-route is enabled, Gordon automatically creates routes for images with domain-like names:
# Push an image with a domain name
docker push registry.mydomain.com/app.example.com:latest
Gordon automatically:
- Detects
app.example.comlooks like a domain - Creates a route:
app.example.com→app.example.com:latest - Deploys the container
- Routes traffic to it
Domain Detection
Gordon recognizes image names as domains when they:
- Contain at least one dot (
.) - Don't start or end with a dot
- Look like valid hostnames
| Image Name | Detected as Domain? |
|---|---|
app.example.com |
Yes |
myapp.dev |
Yes |
staging.api.io |
Yes |
myapp |
No (no dots) |
.invalid |
No (starts with dot) |
myapp. |
No (ends with dot) |
Use Cases
Simplified Deployment
Without auto-route:
# Must define each route in config
[routes]
"app.example.com" = "app.example.com:latest"
With auto-route:
[auto_route]
enabled = true
# No routes needed - just push!
docker push registry.mydomain.com/app.example.com:latest
# Route automatically created
Development Workflow
# Create a new app instantly
docker build -t myapp .
docker tag myapp registry.mydomain.com/newapp.mydomain.com:latest
docker push registry.mydomain.com/newapp.mydomain.com:latest
# newapp.mydomain.com is now live!
Multi-Tenant SaaS
# Quickly provision customer subdomains
docker push registry.mydomain.com/acme.saas.com:latest
docker push registry.mydomain.com/beta.saas.com:latest
docker push registry.mydomain.com/gamma.saas.com:latest
Combining with Manual Routes
Auto-route works alongside manual routes:
[auto_route]
enabled = true
[routes]
# Pinned versions override auto-route
"api.mydomain.com" = "myapi:v2.1.0"
api.mydomain.comuses the manually configuredmyapi:v2.1.0- Other domain-named images create automatic routes
Priority Order
- Manual routes in
[routes]take precedence - Auto-routes are created for domain-named images without manual routes
Examples
Enable Auto-Route
[auto_route]
enabled = true
Development with Auto-Route
[server]
registry_domain = "registry.local"
[auto_route]
enabled = true
# No routes defined - all come from image names
Usage:
docker push registry.local/myapp.local:latest
docker push registry.local/api.local:latest
# Both routes created automatically
Production with Auto-Route
[auto_route]
enabled = true
[routes]
# Critical services with pinned versions
"api.company.com" = "company-api:v2.1.0"
"app.company.com" = "company-app:v1.5.0"
# Other services can use auto-route
Limitations
- Auto-routes always use the pushed image tag
- No support for HTTP-only routes (all HTTPS)
- No automatic attachment configuration
- Cannot pin versions (always uses pushed tag)
For more control, define routes manually in [routes].