-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
82 lines (76 loc) · 1.85 KB
/
docker-compose.yaml
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
78
79
80
81
82
version: "3"
services:
app:
build:
context: .
environment:
PORT: 5433
ports:
- 5433:5432
volumes:
- ./conf/docker.yaml:/conf.yaml
depends_on:
- pg1_1
- pg1_2
- pg2_1
- pg2_2
pg1_1:
image: postgres:13
environment: &pg_env
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- 54321:5432
volumes:
- pg1-1:/var/lib/postgresql/data
- ./conf/init-user-db.sh:/docker-entrypoint-initdb.d/init-user-db.sh
- ./conf/postgres.conf:/etc/postgresql/postgresql.conf
- ./conf/pg_hba.conf:/var/lib/postgresql/data/pg_hba.conf
pg1_2:
image: postgres:13
environment:
<<: *pg_env
MASTER: pg1_1
depends_on:
- pg1_1
ports:
- 54322:5432
volumes:
- pg1-2:/var/lib/postgresql/data
- ./conf/init-user-db.sh:/docker-entrypoint-initdb.d/init-user-db.sh
- ./conf/postgres.conf:/etc/postgresql/postgresql.conf
- ./conf/pg_hba.conf:/etc/postgresql/pg_hba.conf
pg2_1:
image: postgres:13
environment:
<<: *pg_env
ports:
- 54323:5432
volumes:
- pg2-1:/var/lib/postgresql/data
- ./conf/init-user-db.sh:/docker-entrypoint-initdb.d/init-user-db.sh
- ./conf/postgres.conf:/etc/postgresql/postgresql.conf
- ./conf/pg_hba.conf:/etc/postgresql/pg_hba.conf
pg2_2:
image: postgres:13
environment:
<<: *pg_env
MASTER: pg2_1
depends_on:
- pg2_1
ports:
- 54324:5432
volumes:
- pg2-2:/var/lib/postgresql/data
- ./conf/init-user-db.sh:/docker-entrypoint-initdb.d/init-user-db.sh
- ./conf/postgres.conf:/etc/postgresql/postgresql.conf
- ./conf/pg_hba.conf:/etc/postgresql/pg_hba.conf
volumes:
pg1-1:
driver: local
pg1-2:
driver: local
pg2-1:
driver: local
pg2-2:
driver: local