-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
77 lines (72 loc) · 1.56 KB
/
docker-compose.yaml
File metadata and controls
77 lines (72 loc) · 1.56 KB
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
75
76
77
version: '3.8'
services:
primary:
image: postgres:15
container_name: primary
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: testdb
ports:
- "5432:5432"
volumes:
- primary_data:/var/lib/postgresql/data
- ./init/primary:/docker-entrypoint-initdb.d
networks:
- pg_net
replica:
image: postgres:15
container_name: replica
depends_on:
- primary
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: testdb
ports:
- "5433:5432"
volumes:
- replica_data:/var/lib/postgresql/data
- ./init/replica:/docker-entrypoint-initdb.d
networks:
- pg_net
replica2:
image: postgres:15
container_name: replica2
depends_on:
- primary
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: testdb
ports:
- "5434:5432"
volumes:
- replica_data2:/var/lib/postgresql/data
- ./init/replica:/docker-entrypoint-initdb.d
networks:
- pg_net
backend:
image: k3rn3lpanicc/cc-final-backend:latest
container_name: node-backend
depends_on:
- primary
- replica
ports:
- "3000:3000"
networks:
- pg_net
environment:
PRIMARY_HOST: pg-primary
REPLICA_HOST: pg-replica
REPLICA_HOST2: pg-replica2
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: testdb
volumes:
primary_data:
replica_data:
replica_data2:
networks:
pg_net:
driver: bridge