v2.4.0 79b3461

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"

# Use pass for secrets (recommended)
[secrets]
backend = "pass"

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