Configuration Overview
Gordon uses a single TOML configuration file located at ~/.config/gordon/gordon.toml.
Configuration File Location
| Location |
Purpose |
~/.config/gordon/gordon.toml |
Default configuration file |
Custom path via --config flag |
gordon serve --config /path/to/config.toml |
Minimal Configuration
[server]
port = 8080
registry_port = 5000
gordon_domain = "gordon.mydomain.com"
[routes]
"app.mydomain.com" = "myapp:latest"
Full Configuration Reference
For a complete list of all configuration options with their default values, see the Configuration Reference.
Note: This example shows production-style paths. Default paths use ~/.gordon/ for user installations.
# Server settings
[server]
port = 8080 # HTTP proxy port (default: 80)
registry_port = 5000 # Registry port (default: 5000)
gordon_domain = "gordon.mydomain.com" # Required: Gordon domain (registry + API)
# data_dir = "~/.gordon" # Default for user installations
# Authentication (includes secrets backend)
[auth]
enabled = true # Enable registry authentication (default: true)
secrets_backend = "pass" # "pass", "sops", or "unsafe"
token_secret = "gordon/auth/token_secret" # Required: JWT signing secret
token_expiry = "30d" # Duration (1y, 30d, 2w) or 0 for never
# Optional: enable password authentication (for interactive login)
# username = "deploy"
# password_hash = "gordon/auth/password_hash"
# API rate limiting
[api.rate_limit]
enabled = true # Enable rate limiting (default: true)
global_rps = 500 # Max requests/second globally
per_ip_rps = 50 # Max requests/second per IP
burst = 100 # Burst size
trusted_proxies = [] # IPs/CIDRs trusted for X-Forwarded-For
# Deploy behavior
[deploy]
pull_policy = "if-tag-changed" # always, if-not-present, if-tag-changed
readiness_mode = "auto" # auto, docker-health, delay
health_timeout = "90s" # Max wait for health-based readiness
readiness_delay = "5s" # Wait after running before ready
drain_mode = "auto" # auto, inflight, delay
drain_timeout = "30s" # Max wait for in-flight drain
drain_delay = "2s" # Wait after proxy invalidation before stopping the old container
# Logging
[logging]
level = "info" # trace, debug, info, warn, error
format = "console" # console or json
[logging.file]
enabled = true
path = "~/.gordon/logs/gordon.log" # Default location
max_size = 100 # MB before rotation
max_backups = 3 # Old files to keep
max_age = 28 # Days to keep
[logging.container_logs]
enabled = true
dir = "~/.gordon/logs/containers" # Default location
max_size = 100
max_backups = 3
max_age = 28
# Environment variables
[env]
dir = "~/.gordon/env" # Default location
# Volume settings
[volumes]
auto_create = true # Auto-create from Dockerfile VOLUME
prefix = "gordon" # Volume name prefix
preserve = true # Keep volumes on container removal
# Network isolation
[network_isolation]
enabled = true # Per-app isolated networks
network_prefix = "gordon" # Network name prefix
dns_suffix = ".internal" # DNS suffix for services
# Auto-route
[auto_route]
enabled = false # Auto-create routes from image names
# Routes (required)
[routes]
"app.mydomain.com" = "myapp:latest"
"api.mydomain.com" = "myapi:v2.1.0"
# Network groups
[network_groups]
"backend" = ["app.mydomain.com", "api.mydomain.com"]
# Attachments
[attachments]
"app.mydomain.com" = ["postgres:latest", "redis:latest"]
"backend" = ["rabbitmq:latest"]
# Backups
[backups]
enabled = true
schedule = "daily" # "hourly", "daily", "weekly", "monthly"
storage_dir = "~/.gordon/backups"
[backups.retention]
hourly = 24
daily = 7
weekly = 4
monthly = 12
# Images
[images.prune]
enabled = false
schedule = "daily"
keep_last = 3
Configuration Sections
| Section |
Description |
Documentation |
[server] |
Core server settings |
Server |
[auth] |
Authentication and secrets backend |
Auth |
[api.rate_limit] |
Rate limiting configuration |
Rate Limiting |
[deploy] |
Deployment behavior |
Deploy |
[logging] |
Logging configuration |
Logging |
[env] |
Environment variable settings |
Environment |
[volumes] |
Volume management |
Volumes |
[network_isolation] |
Network isolation settings |
Network Isolation |
[auto_route] |
Automatic route creation |
Auto Route |
[routes] |
Domain to image mapping |
Routes |
[external_routes] |
Non-containerized service proxying |
External Routes |
[network_groups] |
Shared service networks |
Network Groups |
[attachments] |
Service dependencies |
Attachments |
[backups] |
Database backups |
Backups |
[images.prune] |
Scheduled image cleanup |
Images |
Default Values
| Setting |
Default |
server.port |
80 |
server.registry_port |
5000 |
server.data_dir |
~/.gordon |
auth.enabled |
true |
auth.secrets_backend |
"unsafe" |
auth.token_expiry |
"30d" |
api.rate_limit.enabled |
true |
api.rate_limit.global_rps |
500 |
api.rate_limit.per_ip_rps |
50 |
api.rate_limit.burst |
100 |
api.rate_limit.trusted_proxies |
[] |
deploy.pull_policy |
"if-tag-changed" |
deploy.readiness_mode |
"auto" |
deploy.health_timeout |
"90s" |
deploy.readiness_delay |
"5s" |
deploy.drain_mode |
"auto" |
deploy.drain_timeout |
"30s" |
deploy.drain_delay |
"2s" |
logging.level |
"info" |
logging.format |
"console" |
logging.file.enabled |
false |
logging.file.max_size |
100 |
logging.file.max_backups |
3 |
logging.file.max_age |
28 |
logging.container_logs.enabled |
true |
volumes.auto_create |
true |
volumes.prefix |
"gordon" |
volumes.preserve |
true |
network_isolation.enabled |
false |
auto_route.enabled |
false |
backups.enabled |
false |
backups.schedule |
"daily" ("hourly", "daily", "weekly", "monthly") |
images.prune.enabled |
false |
images.prune.schedule |
"daily" |
images.prune.keep_last |
3 |
Hot Reload
Gordon watches the configuration file and reloads automatically when changes are detected. You can also trigger a manual reload:
gordon reload
The following settings require a restart to take effect:
server.port
server.registry_port
server.data_dir
auth settings
deploy.pull_policy
deploy.readiness_mode
deploy.health_timeout
deploy.readiness_delay
deploy.drain_mode
deploy.drain_timeout
deploy.drain_delay
Environment Variable Override
Configuration values can be overridden with environment variables:
GORDON_SERVER_PORT=8080 gordon serve
GORDON_LOGGING_LEVEL=debug gordon serve
Pattern: GORDON_SECTION_KEY (uppercase, underscores instead of dots)
source
1# Configuration Overview
2
3Gordon uses a single TOML configuration file located at `~/.config/gordon/gordon.toml`.
4
5## Configuration File Location
6
7| Location | Purpose |
8|----------|---------|
9| `~/.config/gordon/gordon.toml` | Default configuration file |
10| Custom path via `--config` flag | `gordon serve --config /path/to/config.toml` |
11
12## Minimal Configuration
13
14```toml
15[server]
16port = 8080
17registry_port = 5000
18gordon_domain = "gordon.mydomain.com"
19
20[routes]
21"app.mydomain.com" = "myapp:latest"
22```
23
24## Full Configuration Reference
25
26For a complete list of all configuration options with their default values, see the [Configuration Reference](./reference.md).
27
28> **Note:** This example shows production-style paths. Default paths use `~/.gordon/` for user installations.
29
30```toml
31# Server settings
32[server]
33port = 8080 # HTTP proxy port (default: 80)
34registry_port = 5000 # Registry port (default: 5000)
35gordon_domain = "gordon.mydomain.com" # Required: Gordon domain (registry + API)
36# data_dir = "~/.gordon" # Default for user installations
37
38# Authentication (includes secrets backend)
39[auth]
40enabled = true # Enable registry authentication (default: true)
41secrets_backend = "pass" # "pass", "sops", or "unsafe"
42token_secret = "gordon/auth/token_secret" # Required: JWT signing secret
43token_expiry = "30d" # Duration (1y, 30d, 2w) or 0 for never
44# Optional: enable password authentication (for interactive login)
45# username = "deploy"
46# password_hash = "gordon/auth/password_hash"
47
48# API rate limiting
49[api.rate_limit]
50enabled = true # Enable rate limiting (default: true)
51global_rps = 500 # Max requests/second globally
52per_ip_rps = 50 # Max requests/second per IP
53burst = 100 # Burst size
54trusted_proxies = [] # IPs/CIDRs trusted for X-Forwarded-For
55
56# Deploy behavior
57[deploy]
58pull_policy = "if-tag-changed" # always, if-not-present, if-tag-changed
59readiness_mode = "auto" # auto, docker-health, delay
60health_timeout = "90s" # Max wait for health-based readiness
61readiness_delay = "5s" # Wait after running before ready
62drain_mode = "auto" # auto, inflight, delay
63drain_timeout = "30s" # Max wait for in-flight drain
64drain_delay = "2s" # Wait after proxy invalidation before stopping the old container
65
66# Logging
67[logging]
68level = "info" # trace, debug, info, warn, error
69format = "console" # console or json
70
71[logging.file]
72enabled = true
73path = "~/.gordon/logs/gordon.log" # Default location
74max_size = 100 # MB before rotation
75max_backups = 3 # Old files to keep
76max_age = 28 # Days to keep
77
78[logging.container_logs]
79enabled = true
80dir = "~/.gordon/logs/containers" # Default location
81max_size = 100
82max_backups = 3
83max_age = 28
84
85# Environment variables
86[env]
87dir = "~/.gordon/env" # Default location
88
89# Volume settings
90[volumes]
91auto_create = true # Auto-create from Dockerfile VOLUME
92prefix = "gordon" # Volume name prefix
93preserve = true # Keep volumes on container removal
94
95# Network isolation
96[network_isolation]
97enabled = true # Per-app isolated networks
98network_prefix = "gordon" # Network name prefix
99dns_suffix = ".internal" # DNS suffix for services
100
101# Auto-route
102[auto_route]
103enabled = false # Auto-create routes from image names
104
105# Routes (required)
106[routes]
107"app.mydomain.com" = "myapp:latest"
108"api.mydomain.com" = "myapi:v2.1.0"
109
110# Network groups
111[network_groups]
112"backend" = ["app.mydomain.com", "api.mydomain.com"]
113
114# Attachments
115[attachments]
116"app.mydomain.com" = ["postgres:latest", "redis:latest"]
117"backend" = ["rabbitmq:latest"]
118
119# Backups
120[backups]
121enabled = true
122schedule = "daily" # "hourly", "daily", "weekly", "monthly"
123storage_dir = "~/.gordon/backups"
124
125[backups.retention]
126hourly = 24
127daily = 7
128weekly = 4
129monthly = 12
130
131# Images
132[images.prune]
133enabled = false
134schedule = "daily"
135keep_last = 3
136```
137
138## Configuration Sections
139
140| Section | Description | Documentation |
141|---------|-------------|---------------|
142| `[server]` | Core server settings | [Server](./server.md) |
143| `[auth]` | Authentication and secrets backend | [Auth](./auth.md) |
144| `[api.rate_limit]` | Rate limiting configuration | [Rate Limiting](./rate-limiting.md) |
145| `[deploy]` | Deployment behavior | [Deploy](./deploy.md) |
146| `[logging]` | Logging configuration | [Logging](./logging.md) |
147| `[env]` | Environment variable settings | [Environment](./env.md) |
148| `[volumes]` | Volume management | [Volumes](./volumes.md) |
149| `[network_isolation]` | Network isolation settings | [Network Isolation](./network-isolation.md) |
150| `[auto_route]` | Automatic route creation | [Auto Route](./auto-route.md) |
151| `[routes]` | Domain to image mapping | [Routes](./routes.md) |
152| `[external_routes]` | Non-containerized service proxying | [External Routes](./external-routes.md) |
153| `[network_groups]` | Shared service networks | [Network Groups](./network-groups.md) |
154| `[attachments]` | Service dependencies | [Attachments](./attachments.md) |
155| `[backups]` | Database backups | [Backups](./backups.md) |
156| `[images.prune]` | Scheduled image cleanup | [Images](./images.md) |
157
158## Default Values
159
160| Setting | Default |
161|---------|---------|
162| `server.port` | `80` |
163| `server.registry_port` | `5000` |
164| `server.data_dir` | `~/.gordon` |
165| `auth.enabled` | `true` |
166| `auth.secrets_backend` | `"unsafe"` |
167| `auth.token_expiry` | `"30d"` |
168| `api.rate_limit.enabled` | `true` |
169| `api.rate_limit.global_rps` | `500` |
170| `api.rate_limit.per_ip_rps` | `50` |
171| `api.rate_limit.burst` | `100` |
172| `api.rate_limit.trusted_proxies` | `[]` |
173| `deploy.pull_policy` | `"if-tag-changed"` |
174| `deploy.readiness_mode` | `"auto"` |
175| `deploy.health_timeout` | `"90s"` |
176| `deploy.readiness_delay` | `"5s"` |
177| `deploy.drain_mode` | `"auto"` |
178| `deploy.drain_timeout` | `"30s"` |
179| `deploy.drain_delay` | `"2s"` |
180| `logging.level` | `"info"` |
181| `logging.format` | `"console"` |
182| `logging.file.enabled` | `false` |
183| `logging.file.max_size` | `100` |
184| `logging.file.max_backups` | `3` |
185| `logging.file.max_age` | `28` |
186| `logging.container_logs.enabled` | `true` |
187| `volumes.auto_create` | `true` |
188| `volumes.prefix` | `"gordon"` |
189| `volumes.preserve` | `true` |
190| `network_isolation.enabled` | `false` |
191| `auto_route.enabled` | `false` |
192| `backups.enabled` | `false` |
193| `backups.schedule` | `"daily"` (`"hourly"`, `"daily"`, `"weekly"`, `"monthly"`) |
194| `images.prune.enabled` | `false` |
195| `images.prune.schedule` | `"daily"` |
196| `images.prune.keep_last` | `3` |
197
198## Hot Reload
199
200Gordon watches the configuration file and reloads automatically when changes are detected. You can also trigger a manual reload:
201
202```bash
203gordon reload
204```
205
206The following settings require a restart to take effect:
207
208- `server.port`
209- `server.registry_port`
210- `server.data_dir`
211- `auth` settings
212- `deploy.pull_policy`
213- `deploy.readiness_mode`
214- `deploy.health_timeout`
215- `deploy.readiness_delay`
216- `deploy.drain_mode`
217- `deploy.drain_timeout`
218- `deploy.drain_delay`
219
220## Environment Variable Override
221
222Configuration values can be overridden with environment variables:
223
224```bash
225GORDON_SERVER_PORT=8080 gordon serve
226GORDON_LOGGING_LEVEL=debug gordon serve
227```
228
229Pattern: `GORDON_SECTION_KEY` (uppercase, underscores instead of dots)
230
231## Related
232
233- [Server Configuration](./server.md)
234- [Routes Configuration](./routes.md)
235- [External Routes](./external-routes.md)
236- [Authentication](./auth.md)
237- [Backups](./backups.md)
238- [Images](./images.md)