v2.0.0 ae3e752

README.md RawHistoryFolder

Gordon v2 Configuration Examples

This directory contains configuration examples for different use cases and environments.

πŸ“ Available Examples

πŸš€ minimal.toml

Perfect for getting started

  • Single route configuration
  • Default settings
  • No authentication
  • Ideal for testing and learning

🏠 development.toml

Local development setup

  • Multiple .local domains
  • No authentication for ease of use
  • Third-party development tools
  • localhost registry

πŸ§ͺ staging.toml

Staging and preview environments

  • Branch-based deployments
  • Feature branch testing
  • PR preview environments
  • Separate staging registry

🏭 production.toml

Production-ready configuration

  • Pinned image versions
  • Registry authentication
  • Multiple production services
  • Monitoring tools included

🏒 saas-multi-tenant.toml

Multi-tenant SaaS platform

  • Customer subdomains
  • Custom domains
  • Shared application architecture
  • Enterprise features

πŸ“Š logging.toml

Comprehensive logging configuration

  • Complete logging setup examples
  • Different logging levels and configurations
  • Production and development logging strategies
  • Log rotation and monitoring examples

πŸ”„ rollback-workflow-example.md

Simple version deployment and rollback workflow

  • Manifest annotation-based deployments
  • Simple version changes for deployments and rollbacks
  • Version tracking and deployment strategies

πŸš€ Quick Start

  1. Choose an example that matches your use case
  2. Copy the config file to your Gordon directory:
    cp examples/minimal.toml gordon.toml
    
  3. Edit the configuration with your domains and settings
  4. Start Gordon:
    gordon start
    

πŸ”§ Customization Tips

Domain Configuration

Update the [routes] section with your actual domains:

[routes]
"your-domain.com" = "your-app:latest"
"api.your-domain.com" = "your-api:v1.0.0"

Registry Setup

Configure your registry domain and authentication:

[server]
registry_domain = "registry.your-domain.com"

[registry_auth]
enabled = true
username = "your-username"
password = "your-secure-password"

Container Runtime Setup

Gordon supports Docker and Podman with automatic detection:

[server]
runtime = "auto"  # auto, docker, podman, podman-rootless
socket_path = ""  # optional custom socket path

# Examples:
# runtime = "docker"          # Force Docker
# runtime = "podman"          # Force Podman root
# runtime = "podman-rootless" # Force Podman rootless
# socket_path = "unix:///run/user/1000/podman/podman.sock"

Override with environment variables:

# Works for both Docker and Podman
export CONTAINER_HOST=unix:///custom/path/container.sock
export CONTAINER_HOST=tcp://remote-docker:2376
gordon start

Logging Configuration

Enable comprehensive logging to monitor your deployments:

[logging]
enabled = true                    # Enable file-based logging
level = "info"                   # Log level: trace, debug, info, warn, error
dir = "./logs"                   # Directory for log files
main_log_file = "gordon.log"     # Main application logs
proxy_log_file = "proxy.log"     # HTTP proxy traffic logs
container_log_dir = "containers" # Container logs subdirectory

# Log rotation settings
max_size = 100                   # Max log file size in MB
max_backups = 5                  # Number of old log files to keep
max_age = 30                     # Max age in days
compress = true                  # Compress old log files

See logging.toml for comprehensive logging examples.

Environment Variables

Gordon intelligently merges environment variables from multiple sources:

  1. Dockerfile ENV directives (automatically detected)
  2. Your .env files (override Dockerfile ENV)
  3. Runtime environment (lowest priority)

Dockerfile ENV (Automatic Detection)

FROM node:18-alpine
WORKDIR /app

# Gordon automatically reads these ENV directives
ENV NODE_ENV=production
ENV PORT=3000
ENV LOG_LEVEL=info
ENV DATABASE_HOST=localhost

COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["npm", "start"]

Custom Environment Files

Create .env files for each route: ./data/env/app_yourdomain_com.env

# Your custom overrides (these take precedence over Dockerfile ENV)
DATABASE_HOST=db.mydomain.com
DATABASE_USER=myapp
DATABASE_PASSWORD=${pass:myapp/db-password}
API_KEY=${sops:secrets.yaml:api_key}
# NODE_ENV, PORT, LOG_LEVEL from Dockerfile are preserved

Final Applied Environment

NODE_ENV=production          # From Dockerfile ENV
PORT=3000                    # From Dockerfile ENV
LOG_LEVEL=info              # From Dockerfile ENV
DATABASE_HOST=db.mydomain.com # From .env (overridden)
DATABASE_USER=myapp         # From .env (new)
DATABASE_PASSWORD=secret123  # From .env via pass
API_KEY=abc123              # From .env via SOPS

Production Environment Variables

For sensitive production data:

export GORDON_REGISTRY_PASSWORD="your-secure-password"
export GORDON_SSL_EMAIL="admin@your-domain.com"

Volume Management

Gordon automatically creates persistent volumes from Dockerfile VOLUME directives:

Dockerfile VOLUME (Automatic Detection)

FROM postgres:15
# Gordon automatically creates persistent volumes for these paths
VOLUME ["/var/lib/postgresql/data"]

# Multi-volume example
FROM myapp:latest
VOLUME ["/app/data", "/app/logs", "/app/uploads"]

Volume Features

  • Zero Configuration: Reads VOLUME directives automatically
  • Persistent Storage: Data survives container restarts and updates
  • Predictable Naming: gordon-{domain}-{path-hash} format
  • Cross-Platform: Works with Docker and Podman

Volume Configuration (Optional)

[volumes]
auto_create = true    # Default: true (automatically handle VOLUME directives)
prefix = "gordon"     # Default: "gordon" (volume name prefix)
preserve = true       # Default: true (keep volumes when containers are removed)

Complete Dockerfile Example

FROM node:18-alpine
WORKDIR /app

# Environment variables (automatically merged with your .env files)
ENV NODE_ENV=production
ENV PORT=3000
ENV LOG_LEVEL=info

# Install dependencies
COPY package*.json ./
RUN npm install

# Copy application code
COPY . .

# Persistent storage (automatically managed by Gordon)
VOLUME ["/app/data", "/app/logs"]

# Network configuration
EXPOSE 3000

# Start command
CMD ["npm", "start"]

When you deploy this image:

  • Gordon reads ENV directives and merges with your .env files
  • Gordon creates volumes for /app/data and /app/logs
  • Your data persists across deployments and reboots
  • Environment variables are intelligently managed

🌐 DNS Configuration

For all examples except development, set up these DNS records:

Type  Name                    Content
A     app.your-domain.com     YOUR_SERVER_IP
A     api.your-domain.com     YOUR_SERVER_IP  
A     registry.your-domain.com YOUR_SERVER_IP

Or use a wildcard:

Type  Name                    Content
A     *.your-domain.com       YOUR_SERVER_IP

Local Development

For the development example, add to /etc/hosts:

127.0.0.1  app.local
127.0.0.1  api.local
127.0.0.1  admin.local

πŸ”„ Workflow Examples

Simple Deployment

# Build your app
export VERSION=latest
docker build --tag myapp:$VERSION --tag registry.your-domain.com/myapp:$VERSION .

# Push to deploy
docker push registry.your-domain.com/myapp:$VERSION

Version Management

# Build and push specific version
export VERSION=v1.2.0
docker build --tag myapp:$VERSION --tag registry.your-domain.com/myapp:$VERSION .
docker push registry.your-domain.com/myapp:$VERSION

# Update config
# "app.your-domain.com" = "myapp:v1.2.0"

Simple Version Deployment with Manifest Annotations

# Build and push your versions first
export VERSION=v1.1.0
podman build --tag myapp:$VERSION --tag registry.your-domain.com/myapp:$VERSION .
podman push registry.your-domain.com/myapp:$VERSION

export VERSION=v1.2.0
podman build --tag myapp:$VERSION --tag registry.your-domain.com/myapp:$VERSION .
podman push registry.your-domain.com/myapp:$VERSION

# Deploy v1.2.0
export VERSION=v1.2.0
podman manifest create myapp:latest
podman manifest add myapp:latest registry.your-domain.com/myapp:$VERSION
podman manifest annotate myapp:latest --annotation version=$VERSION registry.your-domain.com/myapp:$VERSION
podman manifest push myapp:latest registry.your-domain.com/myapp:latest

# Rollback to v1.1.0 (just change the version)
export VERSION=v1.1.0
podman manifest create myapp:latest --amend
podman manifest add myapp:latest registry.your-domain.com/myapp:$VERSION
podman manifest annotate myapp:latest --annotation version=$VERSION registry.your-domain.com/myapp:$VERSION
podman manifest push myapp:latest registry.your-domain.com/myapp:latest

See rollback-workflow-example.md for complete version deployment workflow documentation.

🀝 Need Help?

  • πŸ“– Read the main README for detailed documentation
  • πŸ” Check the logs for deployment issues
  • πŸ› Open an issue if you find problems with these examples
  • πŸ’‘ Contribute your own configuration examples!

These examples are starting points - customize them for your specific needs!

source
1# Gordon v2 Configuration Examples
2
3This directory contains configuration examples for different use cases and environments.
4
5## πŸ“ Available Examples
6
7### πŸš€ [`minimal.toml`](minimal.toml)
8**Perfect for getting started**
9- Single route configuration
10- Default settings
11- No authentication
12- Ideal for testing and learning
13
14### 🏠 [`development.toml`](development.toml)
15**Local development setup**
16- Multiple .local domains
17- No authentication for ease of use
18- Third-party development tools
19- localhost registry
20
21### πŸ§ͺ [`staging.toml`](staging.toml)
22**Staging and preview environments**
23- Branch-based deployments
24- Feature branch testing
25- PR preview environments
26- Separate staging registry
27
28### 🏭 [`production.toml`](production.toml)
29**Production-ready configuration**
30- Pinned image versions
31- Registry authentication
32- Multiple production services
33- Monitoring tools included
34
35### 🏒 [`saas-multi-tenant.toml`](saas-multi-tenant.toml)
36**Multi-tenant SaaS platform**
37- Customer subdomains
38- Custom domains
39- Shared application architecture
40- Enterprise features
41
42### πŸ“Š [`logging.toml`](logging.toml)
43**Comprehensive logging configuration**
44- Complete logging setup examples
45- Different logging levels and configurations
46- Production and development logging strategies
47- Log rotation and monitoring examples
48
49### πŸ”„ [`rollback-workflow-example.md`](rollback-workflow-example.md)
50**Simple version deployment and rollback workflow**
51- Manifest annotation-based deployments
52- Simple version changes for deployments and rollbacks
53- Version tracking and deployment strategies
54
55## πŸš€ Quick Start
56
571. **Choose an example** that matches your use case
582. **Copy the config file** to your Gordon directory:
59   ```bash
60   cp examples/minimal.toml gordon.toml
61   ```
623. **Edit the configuration** with your domains and settings
634. **Start Gordon**:
64   ```bash
65   gordon start
66   ```
67
68## πŸ”§ Customization Tips
69
70### Domain Configuration
71Update the `[routes]` section with your actual domains:
72```toml
73[routes]
74"your-domain.com" = "your-app:latest"
75"api.your-domain.com" = "your-api:v1.0.0"
76```
77
78### Registry Setup
79Configure your registry domain and authentication:
80```toml
81[server]
82registry_domain = "registry.your-domain.com"
83
84[registry_auth]
85enabled = true
86username = "your-username"
87password = "your-secure-password"
88```
89
90### Container Runtime Setup
91Gordon supports Docker and Podman with automatic detection:
92```toml
93[server]
94runtime = "auto"  # auto, docker, podman, podman-rootless
95socket_path = ""  # optional custom socket path
96
97# Examples:
98# runtime = "docker"          # Force Docker
99# runtime = "podman"          # Force Podman root
100# runtime = "podman-rootless" # Force Podman rootless
101# socket_path = "unix:///run/user/1000/podman/podman.sock"
102```
103
104Override with environment variables:
105```bash
106# Works for both Docker and Podman
107export CONTAINER_HOST=unix:///custom/path/container.sock
108export CONTAINER_HOST=tcp://remote-docker:2376
109gordon start
110```
111
112### Logging Configuration
113Enable comprehensive logging to monitor your deployments:
114```toml
115[logging]
116enabled = true                    # Enable file-based logging
117level = "info"                   # Log level: trace, debug, info, warn, error
118dir = "./logs"                   # Directory for log files
119main_log_file = "gordon.log"     # Main application logs
120proxy_log_file = "proxy.log"     # HTTP proxy traffic logs
121container_log_dir = "containers" # Container logs subdirectory
122
123# Log rotation settings
124max_size = 100                   # Max log file size in MB
125max_backups = 5                  # Number of old log files to keep
126max_age = 30                     # Max age in days
127compress = true                  # Compress old log files
128```
129
130See [`logging.toml`](logging.toml) for comprehensive logging examples.
131
132### Environment Variables
133Gordon intelligently merges environment variables from multiple sources:
134
1351. **Dockerfile ENV directives** (automatically detected)
1362. **Your .env files** (override Dockerfile ENV)
1373. **Runtime environment** (lowest priority)
138
139#### Dockerfile ENV (Automatic Detection)
140```dockerfile
141FROM node:18-alpine
142WORKDIR /app
143
144# Gordon automatically reads these ENV directives
145ENV NODE_ENV=production
146ENV PORT=3000
147ENV LOG_LEVEL=info
148ENV DATABASE_HOST=localhost
149
150COPY package*.json ./
151RUN npm install
152COPY . .
153EXPOSE 3000
154CMD ["npm", "start"]
155```
156
157#### Custom Environment Files
158Create `.env` files for each route: `./data/env/app_yourdomain_com.env`
159```bash
160# Your custom overrides (these take precedence over Dockerfile ENV)
161DATABASE_HOST=db.mydomain.com
162DATABASE_USER=myapp
163DATABASE_PASSWORD=${pass:myapp/db-password}
164API_KEY=${sops:secrets.yaml:api_key}
165# NODE_ENV, PORT, LOG_LEVEL from Dockerfile are preserved
166```
167
168#### Final Applied Environment
169```bash
170NODE_ENV=production          # From Dockerfile ENV
171PORT=3000                    # From Dockerfile ENV
172LOG_LEVEL=info              # From Dockerfile ENV
173DATABASE_HOST=db.mydomain.com # From .env (overridden)
174DATABASE_USER=myapp         # From .env (new)
175DATABASE_PASSWORD=secret123  # From .env via pass
176API_KEY=abc123              # From .env via SOPS
177```
178
179#### Production Environment Variables
180For sensitive production data:
181```bash
182export GORDON_REGISTRY_PASSWORD="your-secure-password"
183export GORDON_SSL_EMAIL="admin@your-domain.com"
184```
185
186### Volume Management
187Gordon automatically creates persistent volumes from Dockerfile VOLUME directives:
188
189#### Dockerfile VOLUME (Automatic Detection)
190```dockerfile
191FROM postgres:15
192# Gordon automatically creates persistent volumes for these paths
193VOLUME ["/var/lib/postgresql/data"]
194
195# Multi-volume example
196FROM myapp:latest
197VOLUME ["/app/data", "/app/logs", "/app/uploads"]
198```
199
200#### Volume Features
201- **Zero Configuration**: Reads VOLUME directives automatically
202- **Persistent Storage**: Data survives container restarts and updates
203- **Predictable Naming**: `gordon-{domain}-{path-hash}` format
204- **Cross-Platform**: Works with Docker and Podman
205
206#### Volume Configuration (Optional)
207```toml
208[volumes]
209auto_create = true    # Default: true (automatically handle VOLUME directives)
210prefix = "gordon"     # Default: "gordon" (volume name prefix)
211preserve = true       # Default: true (keep volumes when containers are removed)
212```
213
214#### Complete Dockerfile Example
215```dockerfile
216FROM node:18-alpine
217WORKDIR /app
218
219# Environment variables (automatically merged with your .env files)
220ENV NODE_ENV=production
221ENV PORT=3000
222ENV LOG_LEVEL=info
223
224# Install dependencies
225COPY package*.json ./
226RUN npm install
227
228# Copy application code
229COPY . .
230
231# Persistent storage (automatically managed by Gordon)
232VOLUME ["/app/data", "/app/logs"]
233
234# Network configuration
235EXPOSE 3000
236
237# Start command
238CMD ["npm", "start"]
239```
240
241When you deploy this image:
242- Gordon reads ENV directives and merges with your .env files
243- Gordon creates volumes for `/app/data` and `/app/logs`
244- Your data persists across deployments and reboots
245- Environment variables are intelligently managed
246
247## 🌐 DNS Configuration
248
249### Cloudflare Setup (Recommended)
250For all examples except development, set up these DNS records:
251
252```
253Type  Name                    Content
254A     app.your-domain.com     YOUR_SERVER_IP
255A     api.your-domain.com     YOUR_SERVER_IP  
256A     registry.your-domain.com YOUR_SERVER_IP
257```
258
259Or use a wildcard:
260```
261Type  Name                    Content
262A     *.your-domain.com       YOUR_SERVER_IP
263```
264
265### Local Development
266For the development example, add to `/etc/hosts`:
267```
268127.0.0.1  app.local
269127.0.0.1  api.local
270127.0.0.1  admin.local
271```
272
273## πŸ”„ Workflow Examples
274
275### Simple Deployment
276```bash
277# Build your app
278export VERSION=latest
279docker build --tag myapp:$VERSION --tag registry.your-domain.com/myapp:$VERSION .
280
281# Push to deploy
282docker push registry.your-domain.com/myapp:$VERSION
283```
284
285### Version Management
286```bash
287# Build and push specific version
288export VERSION=v1.2.0
289docker build --tag myapp:$VERSION --tag registry.your-domain.com/myapp:$VERSION .
290docker push registry.your-domain.com/myapp:$VERSION
291
292# Update config
293# "app.your-domain.com" = "myapp:v1.2.0"
294```
295
296### Simple Version Deployment with Manifest Annotations
297```bash
298# Build and push your versions first
299export VERSION=v1.1.0
300podman build --tag myapp:$VERSION --tag registry.your-domain.com/myapp:$VERSION .
301podman push registry.your-domain.com/myapp:$VERSION
302
303export VERSION=v1.2.0
304podman build --tag myapp:$VERSION --tag registry.your-domain.com/myapp:$VERSION .
305podman push registry.your-domain.com/myapp:$VERSION
306
307# Deploy v1.2.0
308export VERSION=v1.2.0
309podman manifest create myapp:latest
310podman manifest add myapp:latest registry.your-domain.com/myapp:$VERSION
311podman manifest annotate myapp:latest --annotation version=$VERSION registry.your-domain.com/myapp:$VERSION
312podman manifest push myapp:latest registry.your-domain.com/myapp:latest
313
314# Rollback to v1.1.0 (just change the version)
315export VERSION=v1.1.0
316podman manifest create myapp:latest --amend
317podman manifest add myapp:latest registry.your-domain.com/myapp:$VERSION
318podman manifest annotate myapp:latest --annotation version=$VERSION registry.your-domain.com/myapp:$VERSION
319podman manifest push myapp:latest registry.your-domain.com/myapp:latest
320```
321
322See [`rollback-workflow-example.md`](rollback-workflow-example.md) for complete version deployment workflow documentation.
323
324## 🀝 Need Help?
325
326- πŸ“– **Read the main [README](../README.md)** for detailed documentation
327- πŸ” **Check the logs** for deployment issues
328- πŸ› **Open an issue** if you find problems with these examples
329- πŸ’‘ **Contribute** your own configuration examples!
330
331---
332*These examples are starting points - customize them for your specific needs!*

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