v2.30.0-pre5 7568a1c

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"

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