v2.2.7 aefe19e

auto-route.md RawHistoryFolder

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:

  1. Detects app.example.com looks like a domain
  2. Creates a route: app.example.com → app.example.com:latest
  3. Deploys the container
  4. 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.com uses the manually configured myapi:v2.1.0
  • Other domain-named images create automatic routes

Priority Order

  1. Manual routes in [routes] take precedence
  2. 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].

source
1# Auto Route Configuration
2
3Automatically create routes from image names that contain domains.
4
5## Configuration
6
7```toml
8[auto_route]
9enabled = true
10```
11
12## Options
13
14| Option | Type | Default | Description |
15|--------|------|---------|-------------|
16| `enabled` | bool | `false` | Enable automatic route creation |
17
18## How It Works
19
20When auto-route is enabled, Gordon automatically creates routes for images with domain-like names:
21
22```bash
23# Push an image with a domain name
24docker push registry.mydomain.com/app.example.com:latest
25```
26
27Gordon automatically:
281. Detects `app.example.com` looks like a domain
292. Creates a route: `app.example.com` → `app.example.com:latest`
303. Deploys the container
314. Routes traffic to it
32
33## Domain Detection
34
35Gordon recognizes image names as domains when they:
36
37- Contain at least one dot (`.`)
38- Don't start or end with a dot
39- Look like valid hostnames
40
41| Image Name | Detected as Domain? |
42|------------|-------------------|
43| `app.example.com` | Yes |
44| `myapp.dev` | Yes |
45| `staging.api.io` | Yes |
46| `myapp` | No (no dots) |
47| `.invalid` | No (starts with dot) |
48| `myapp.` | No (ends with dot) |
49
50## Use Cases
51
52### Simplified Deployment
53
54Without auto-route:
55```toml
56# Must define each route in config
57[routes]
58"app.example.com" = "app.example.com:latest"
59```
60
61With auto-route:
62```toml
63[auto_route]
64enabled = true
65# No routes needed - just push!
66```
67
68```bash
69docker push registry.mydomain.com/app.example.com:latest
70# Route automatically created
71```
72
73### Development Workflow
74
75```bash
76# Create a new app instantly
77docker build -t myapp .
78docker tag myapp registry.mydomain.com/newapp.mydomain.com:latest
79docker push registry.mydomain.com/newapp.mydomain.com:latest
80# newapp.mydomain.com is now live!
81```
82
83### Multi-Tenant SaaS
84
85```bash
86# Quickly provision customer subdomains
87docker push registry.mydomain.com/acme.saas.com:latest
88docker push registry.mydomain.com/beta.saas.com:latest
89docker push registry.mydomain.com/gamma.saas.com:latest
90```
91
92## Combining with Manual Routes
93
94Auto-route works alongside manual routes:
95
96```toml
97[auto_route]
98enabled = true
99
100[routes]
101# Pinned versions override auto-route
102"api.mydomain.com" = "myapi:v2.1.0"
103```
104
105- `api.mydomain.com` uses the manually configured `myapi:v2.1.0`
106- Other domain-named images create automatic routes
107
108## Priority Order
109
1101. **Manual routes** in `[routes]` take precedence
1112. **Auto-routes** are created for domain-named images without manual routes
112
113## Examples
114
115### Enable Auto-Route
116
117```toml
118[auto_route]
119enabled = true
120```
121
122### Development with Auto-Route
123
124```toml
125[server]
126registry_domain = "registry.local"
127
128[auto_route]
129enabled = true
130
131# No routes defined - all come from image names
132```
133
134Usage:
135```bash
136docker push registry.local/myapp.local:latest
137docker push registry.local/api.local:latest
138# Both routes created automatically
139```
140
141### Production with Auto-Route
142
143```toml
144[auto_route]
145enabled = true
146
147[routes]
148# Critical services with pinned versions
149"api.company.com" = "company-api:v2.1.0"
150"app.company.com" = "company-app:v1.5.0"
151
152# Other services can use auto-route
153```
154
155## Limitations
156
157- Auto-routes always use the pushed image tag
158- No support for HTTP-only routes (all HTTPS)
159- No automatic attachment configuration
160- Cannot pin versions (always uses pushed tag)
161
162For more control, define routes manually in `[routes]`.
163
164## Related
165
166- [Routes](./routes.md)
167- [Configuration Overview](./index.md)

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close