Skip to content

Commit 0605e1d

Browse files
committed
Add the assignment
[refs #b1914ba49eb8]
1 parent bfd3e2d commit 0605e1d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

load_balancer/assignment2.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+

0 commit comments

Comments
 (0)