-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-managers.yml
74 lines (70 loc) · 1.86 KB
/
docker-compose-managers.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
services:
database:
image: postgres:12
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=ds-assgn-2-mgr
# configs:
# - wal_level=logical
volumes:
- ./db-data-mgr/:/var/lib/postgresql/data/
ports:
- 5442:5432
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres -d ds-assgn-2-mgr" ]
interval: 15s
timeout: 30s
retries: 5
start_period: 5s
# Broker Manager Leader
leader-mgr:
build: ./broker-manager
command: uvicorn main:app --host 0.0.0.0 --port 8091 --reload
environment:
- DB_HOST=database
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_PORT=5442
- DB_NAME=ds-assgn-2-mgr
- MGR_URL=http://localhost:8091
- MGR_LEADER_URL=http://localhost:8091
volumes:
- ./broker-manager:/code
depends_on:
database:
condition: service_healthy
# Broker Manager Follower
follower-mgr-1:
build: ./broker-manager
command: uvicorn main:app --host 0.0.0.0 --port 8092 --reload
environment:
- DB_HOST=database
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_PORT=5442
- DB_NAME=ds-assgn-2-mgr
- MGR_URL=http://localhost:8092
- MGR_LEADER_URL=http://localhost:8091
volumes:
- ./broker-manager:/code
depends_on:
database:
condition: service_healthy
# Broker Manager Follower
follower-mgr-2:
build: ./broker-manager
command: uvicorn main:app --host 0.0.0.0 --port 8093 --reload
environment:
- DB_HOST=database
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_PORT=5442
- DB_NAME=ds-assgn-2-mgr
- MGR_URL=http://localhost:8093
- MGR_LEADER_URL=http://localhost:8091
volumes:
- ./broker-manager:/code
depends_on:
database:
condition: service_healthy