v2.6.0 fe25b4f

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