v2.2.7 aefe19e

index.md RawHistoryFolder

Deployment Overview

Strategies for deploying applications with Gordon.

Deployment Methods

Method Use Case
Manual Push Development, one-off deploys
GitHub Actions Automated CI/CD
GitLab CI Automated CI/CD
Generic CI Any CI/CD system

Basic Deployment Workflow

1. Build Locally

docker build -t myapp .

2. Tag for Registry

docker tag myapp registry.mydomain.com/myapp:latest

3. Push to Deploy

docker push registry.mydomain.com/myapp:latest

Gordon automatically:

  1. Receives the image
  2. Deploys a new container
  3. Routes traffic to it
  4. Stops the old container

Version Strategies

Latest Tag

Always deploy the most recent build:

docker tag myapp registry.mydomain.com/myapp:latest
docker push registry.mydomain.com/myapp:latest

Configure route:

[routes]
"app.mydomain.com" = "myapp:latest"

Semantic Versioning

Pin to specific versions:

docker tag myapp registry.mydomain.com/myapp:v2.1.0
docker push registry.mydomain.com/myapp:v2.1.0

Configure route:

[routes]
"app.mydomain.com" = "myapp:v2.1.0"

Update config to deploy new version:

[routes]
"app.mydomain.com" = "myapp:v2.2.0"

Git SHA Tags

Tag with commit hash for traceability:

VERSION=$(git rev-parse --short HEAD)
docker tag myapp registry.mydomain.com/myapp:$VERSION
docker push registry.mydomain.com/myapp:$VERSION

Zero-Downtime Deployment

Gordon performs zero-downtime deployments by default:

  1. New container starts while old is still running
  2. Health check waits for new container readiness
  3. Traffic switches to new container
  4. Old container stops after traffic moves
Timeline ─────────────────────────────────────────>

Old Container:  [═══════════════════]
                                    ↓ stop
New Container:           [═════════════════════════>
                         ↑ start    ↑ traffic routed

Environment-Specific Deployments

Development

[routes]
"dev.mydomain.com" = "myapp:latest"
docker push registry.mydomain.com/myapp:latest

Staging

[routes]
"staging.mydomain.com" = "myapp:staging"
docker tag myapp registry.mydomain.com/myapp:staging
docker push registry.mydomain.com/myapp:staging

Production

[routes]
"app.mydomain.com" = "myapp:v2.1.0"
docker tag myapp registry.mydomain.com/myapp:v2.1.0
docker push registry.mydomain.com/myapp:v2.1.0
# Then update gordon.toml and reload

Deployment Checklist

Before deploying:

  • Build passes locally
  • Tests pass
  • Environment file configured (~/.gordon/env/app_mydomain_com.env)
  • DNS pointing to Gordon server
  • Route configured in gordon.toml

After deploying:

  • Container starts successfully
  • Application responds to requests
  • Logs show no errors
  • Health checks pass

Monitoring Deployments

Watch Logs

gordon logs -f

Check Container Status

docker ps | grep gordon

Verify Routing

curl -I https://app.mydomain.com
source
1# Deployment Overview
2
3Strategies for deploying applications with Gordon.
4
5## Deployment Methods
6
7| Method | Use Case |
8|--------|----------|
9| Manual Push | Development, one-off deploys |
10| GitHub Actions | Automated CI/CD |
11| GitLab CI | Automated CI/CD |
12| Generic CI | Any CI/CD system |
13
14## Basic Deployment Workflow
15
16### 1. Build Locally
17
18```bash
19docker build -t myapp .
20```
21
22### 2. Tag for Registry
23
24```bash
25docker tag myapp registry.mydomain.com/myapp:latest
26```
27
28### 3. Push to Deploy
29
30```bash
31docker push registry.mydomain.com/myapp:latest
32```
33
34Gordon automatically:
351. Receives the image
362. Deploys a new container
373. Routes traffic to it
384. Stops the old container
39
40## Version Strategies
41
42### Latest Tag
43
44Always deploy the most recent build:
45
46```bash
47docker tag myapp registry.mydomain.com/myapp:latest
48docker push registry.mydomain.com/myapp:latest
49```
50
51Configure route:
52```toml
53[routes]
54"app.mydomain.com" = "myapp:latest"
55```
56
57### Semantic Versioning
58
59Pin to specific versions:
60
61```bash
62docker tag myapp registry.mydomain.com/myapp:v2.1.0
63docker push registry.mydomain.com/myapp:v2.1.0
64```
65
66Configure route:
67```toml
68[routes]
69"app.mydomain.com" = "myapp:v2.1.0"
70```
71
72Update config to deploy new version:
73```toml
74[routes]
75"app.mydomain.com" = "myapp:v2.2.0"
76```
77
78### Git SHA Tags
79
80Tag with commit hash for traceability:
81
82```bash
83VERSION=$(git rev-parse --short HEAD)
84docker tag myapp registry.mydomain.com/myapp:$VERSION
85docker push registry.mydomain.com/myapp:$VERSION
86```
87
88## Zero-Downtime Deployment
89
90Gordon performs zero-downtime deployments by default:
91
921. **New container starts** while old is still running
932. **Health check** waits for new container readiness
943. **Traffic switches** to new container
954. **Old container stops** after traffic moves
96
97```
98Timeline ─────────────────────────────────────────>
99
100Old Container:  [═══════════════════]
101                                    ↓ stop
102New Container:           [═════════════════════════>
103                         ↑ start    ↑ traffic routed
104```
105
106## Environment-Specific Deployments
107
108### Development
109
110```toml
111[routes]
112"dev.mydomain.com" = "myapp:latest"
113```
114
115```bash
116docker push registry.mydomain.com/myapp:latest
117```
118
119### Staging
120
121```toml
122[routes]
123"staging.mydomain.com" = "myapp:staging"
124```
125
126```bash
127docker tag myapp registry.mydomain.com/myapp:staging
128docker push registry.mydomain.com/myapp:staging
129```
130
131### Production
132
133```toml
134[routes]
135"app.mydomain.com" = "myapp:v2.1.0"
136```
137
138```bash
139docker tag myapp registry.mydomain.com/myapp:v2.1.0
140docker push registry.mydomain.com/myapp:v2.1.0
141# Then update gordon.toml and reload
142```
143
144## Deployment Checklist
145
146Before deploying:
147
148- [ ] Build passes locally
149- [ ] Tests pass
150- [ ] Environment file configured (`~/.gordon/env/app_mydomain_com.env`)
151- [ ] DNS pointing to Gordon server
152- [ ] Route configured in `gordon.toml`
153
154After deploying:
155
156- [ ] Container starts successfully
157- [ ] Application responds to requests
158- [ ] Logs show no errors
159- [ ] Health checks pass
160
161## Monitoring Deployments
162
163### Watch Logs
164
165```bash
166gordon logs -f
167```
168
169### Check Container Status
170
171```bash
172docker ps | grep gordon
173```
174
175### Verify Routing
176
177```bash
178curl -I https://app.mydomain.com
179```
180
181## Related
182
183- [GitHub Actions](./github-actions.md)
184- [Rollback](./rollback.md)
185- [Routes Configuration](../config/routes.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