File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## Scaling the application
2
+ ### Current setup
3
+ * File db.env
4
+ ```
5
+ POSTGRES_DB=web_app_db
6
+ POSTGRES_USER=app
7
+ POSTGRES_PASSWORD=secret
8
+ ```
9
+
10
+ * File app.env
11
+ ```
12
+ POSTGRES_DB=web_app_db
13
+ POSTGRES_USER=app
14
+ POSTGRES_PASSWORD=secret
15
+ POSTGRES_HOST=pg
16
+ ```
17
+
18
+ ```
19
+ docker network create mynet
20
+
21
+ docker container run --network mynet --env-file db.env -v pgdata:/var/lib/postgresql/data -d --name pg postgres:9.6.6-alpine
22
+
23
+ docker container run --network mynet --env-file app.env -d --name webapp jfahrer/demo_web_app:latest
24
+
25
+ docker container run --network mynet -e PROXY_UPSTREAM=webapp:9292 -d -p 80:80 --name lb jfahrer/lb:latest
26
+ ```
27
+
28
+ ### Use network aliases
29
+ * Run the demo_web_app without a name
30
+ * Assign the network alias ` webapp `
31
+ * Run multiple instances (5-10)
32
+ * Browse localhost
33
+
34
+
You can’t perform that action at this time.
0 commit comments