v2.10.0 893d8fa

production.md RawHistoryFolder

Production Configuration

A complete Gordon configuration for production environments.

When to Use

  • Production deployments
  • Multiple applications
  • Services requiring databases

Configuration

# ~/.config/gordon/gordon.toml

# Server settings
[server]
port = 8080                              # Cloudflare forwards 443 → 8080
registry_port = 5000
gordon_domain = "gordon.company.com"

# Authentication with pass backend (recommended)
[auth]
enabled = true
secrets_backend = "pass"
token_secret = "gordon/auth/token_secret"

# File-based logging with rotation
[logging]
level = "info"
format = "json"

[logging.file]
enabled = true
path = "~/.gordon/logs/gordon.log"
max_size = 100
max_backups = 10
max_age = 90

[logging.container_logs]
enabled = true                           # enabled by default
dir = "~/.gordon/logs/containers"
max_size = 100
max_backups = 10
max_age = 90

# Environment directory
[env]
dir = "~/.gordon/env"

# Volume settings (all enabled by default)
[volumes]
auto_create = true
prefix = "gordon"
preserve = true

# Network isolation for security
[network_isolation]
enabled = true
network_prefix = "prod"
dns_suffix = ".internal"

# Application routes with pinned versions
[routes]
"app.company.com" = "company-app:v2.1.0"
"api.company.com" = "company-api:v1.5.2"
"admin.company.com" = "admin-panel:v1.0.1"
"docs.company.com" = "company-docs:latest"

# Network groups for shared services
[network_groups]
"backend" = ["app.company.com", "api.company.com"]

# Service attachments
[attachments]
"backend" = ["company-redis:latest"]
"app.company.com" = ["company-postgres:latest"]
"api.company.com" = ["company-postgres:latest"]

Setup Steps

1. Install Pass

sudo apt install pass gnupg
gpg --gen-key
pass init your-gpg-key-id

2. Store Token Secret

# Generate random secret
openssl rand -base64 32 | pass insert -m gordon/auth/token_secret

3. Generate CI Token

gordon auth token generate --subject ci-bot --scopes push,pull --expiry 0

4. Create Environment Files

# App environment
cat > ~/.gordon/env/app_company_com.env <<EOF
NODE_ENV=production
PORT=3000
DATABASE_URL=postgresql://company-postgres:5432/app
DATABASE_PASSWORD=\${pass:company/db-password}
REDIS_URL=redis://company-redis:6379
EOF

# API environment
cat > ~/.gordon/env/api_company_com.env <<EOF
NODE_ENV=production
PORT=8080
DATABASE_URL=postgresql://company-postgres:5432/api
DATABASE_PASSWORD=\${pass:company/db-password}
REDIS_URL=redis://company-redis:6379
EOF

5. Configure Cloudflare

Type Name Content Proxy
A app VPS IP Yes
A api VPS IP Yes
A admin VPS IP Yes
A registry VPS IP Yes

6. Start Gordon

systemctl --user enable --now gordon

Features Enabled

Feature Status
Registry Enabled
Token Auth Enabled
File Logging Enabled with rotation
Container Logs Enabled with rotation
Network Isolation Enabled
Attachments Configured
Secrets (pass) Enabled

Deployment Workflow

# Build locally
docker build -t company-app .

# Tag with version
docker tag company-app gordon.company.com/company-app:v2.2.0

# Push to deploy
docker push gordon.company.com/company-app:v2.2.0

# Update config with new version
vim ~/.config/gordon/gordon.toml
# Change: "app.company.com" = "company-app:v2.2.0"

# Reload to deploy
gordon reload
source
1# Production Configuration
2
3A complete Gordon configuration for production environments.
4
5## When to Use
6
7- Production deployments
8- Multiple applications
9- Services requiring databases
10
11## Configuration
12
13```toml
14# ~/.config/gordon/gordon.toml
15
16# Server settings
17[server]
18port = 8080                              # Cloudflare forwards 443 → 8080
19registry_port = 5000
20gordon_domain = "gordon.company.com"
21
22# Authentication with pass backend (recommended)
23[auth]
24enabled = true
25secrets_backend = "pass"
26token_secret = "gordon/auth/token_secret"
27
28# File-based logging with rotation
29[logging]
30level = "info"
31format = "json"
32
33[logging.file]
34enabled = true
35path = "~/.gordon/logs/gordon.log"
36max_size = 100
37max_backups = 10
38max_age = 90
39
40[logging.container_logs]
41enabled = true                           # enabled by default
42dir = "~/.gordon/logs/containers"
43max_size = 100
44max_backups = 10
45max_age = 90
46
47# Environment directory
48[env]
49dir = "~/.gordon/env"
50
51# Volume settings (all enabled by default)
52[volumes]
53auto_create = true
54prefix = "gordon"
55preserve = true
56
57# Network isolation for security
58[network_isolation]
59enabled = true
60network_prefix = "prod"
61dns_suffix = ".internal"
62
63# Application routes with pinned versions
64[routes]
65"app.company.com" = "company-app:v2.1.0"
66"api.company.com" = "company-api:v1.5.2"
67"admin.company.com" = "admin-panel:v1.0.1"
68"docs.company.com" = "company-docs:latest"
69
70# Network groups for shared services
71[network_groups]
72"backend" = ["app.company.com", "api.company.com"]
73
74# Service attachments
75[attachments]
76"backend" = ["company-redis:latest"]
77"app.company.com" = ["company-postgres:latest"]
78"api.company.com" = ["company-postgres:latest"]
79```
80
81## Setup Steps
82
83### 1. Install Pass
84
85```bash
86sudo apt install pass gnupg
87gpg --gen-key
88pass init your-gpg-key-id
89```
90
91### 2. Store Token Secret
92
93```bash
94# Generate random secret
95openssl rand -base64 32 | pass insert -m gordon/auth/token_secret
96```
97
98### 3. Generate CI Token
99
100```bash
101gordon auth token generate --subject ci-bot --scopes push,pull --expiry 0
102```
103
104### 4. Create Environment Files
105
106```bash
107# App environment
108cat > ~/.gordon/env/app_company_com.env <<EOF
109NODE_ENV=production
110PORT=3000
111DATABASE_URL=postgresql://company-postgres:5432/app
112DATABASE_PASSWORD=\${pass:company/db-password}
113REDIS_URL=redis://company-redis:6379
114EOF
115
116# API environment
117cat > ~/.gordon/env/api_company_com.env <<EOF
118NODE_ENV=production
119PORT=8080
120DATABASE_URL=postgresql://company-postgres:5432/api
121DATABASE_PASSWORD=\${pass:company/db-password}
122REDIS_URL=redis://company-redis:6379
123EOF
124```
125
126### 5. Configure Cloudflare
127
128| Type | Name | Content | Proxy |
129|------|------|---------|-------|
130| A | `app` | VPS IP | Yes |
131| A | `api` | VPS IP | Yes |
132| A | `admin` | VPS IP | Yes |
133| A | `registry` | VPS IP | Yes |
134
135### 6. Start Gordon
136
137```bash
138systemctl --user enable --now gordon
139```
140
141## Features Enabled
142
143| Feature | Status |
144|---------|--------|
145| Registry | Enabled |
146| Token Auth | Enabled |
147| File Logging | Enabled with rotation |
148| Container Logs | Enabled with rotation |
149| Network Isolation | Enabled |
150| Attachments | Configured |
151| Secrets (pass) | Enabled |
152
153## Deployment Workflow
154
155```bash
156# Build locally
157docker build -t company-app .
158
159# Tag with version
160docker tag company-app gordon.company.com/company-app:v2.2.0
161
162# Push to deploy
163docker push gordon.company.com/company-app:v2.2.0
164
165# Update config with new version
166vim ~/.config/gordon/gordon.toml
167# Change: "app.company.com" = "company-app:v2.2.0"
168
169# Reload to deploy
170gordon reload
171```
172
173## Related
174
175- [Minimal Configuration](./minimal.md)
176- [Secrets Configuration](/docs/config/secrets.md)
177- [Network Isolation](/docs/config/network-isolation.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