Skip to content

Commit 8ed9a9c

Browse files
committed
Adjust deploying
1 parent 9f7c6c3 commit 8ed9a9c

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

docs/bluegreen.md

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,23 @@ volumes:
3030
name: user-data
3131
```
3232
33-
## 2. Add a Front Proxy
33+
## 2. Bring up both Stacks
34+
35+
```sh
36+
scp compose.yaml youruser@yourserver:blue/compose.yaml
37+
scp compose.yaml youruser@yourserver:green/compose.yaml
38+
```
39+
40+
On the server:
41+
42+
```sh
43+
cd blue
44+
docker compose up -d
45+
cd ../green
46+
docker compose up -d
47+
```
48+
49+
## 3. Add a Front Proxy
3450

3551
The _front proxy_ is a single container that binds ports `80` and `443` on the
3652
server and routes requests into either the Blue or Green stack.
@@ -51,14 +67,7 @@ The front proxy manages TLS, so give it a persistent volume for certificates:
5167
docker volume create caddy_data
5268
```
5369

54-
Create networks for the two stacks:
55-
56-
```sh
57-
docker network create blue_default
58-
docker network create green_default
59-
```
60-
61-
Start the proxy and attach it to both networks:
70+
Start the proxy, attaching it to both networks:
6271

6372
```sh
6473
docker run -d \
@@ -71,7 +80,7 @@ docker run -d \
7180
caddy:2
7281
```
7382

74-
## 3. Deploying/Upgrading
83+
## 4. Upgrading
7584

7685
Deploying is the same as [before](deploying.md), but now we're deploying the
7786
_idle stack_. For this example, `green` is idle so that's the one we're

docs/deploying.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ scp compose.yaml youruser@yourserver:
4545

4646
The stack needs your secrets (passwords, keys, etc.). There are a few options:
4747

48-
1. Write secrets to a `.env` file on the server (convenient but not secure).
48+
1. Put secrets in a `.env` file on the server (convenient but less secure).
4949
1. Set environment variables in the the `docker compose` command, being sure to
5050
disable shell history (inconvenient).
51-
1. Use environment injection in your CI/CD. (Recommended)
51+
1. Use environment injection in your CI/CD.
5252

5353
## 🚀 5. Launch your Stack
5454

0 commit comments

Comments
 (0)