-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
43 lines (40 loc) · 1.01 KB
/
docker-compose.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
version: '3.9'
services:
pg-master:
image: 'pg-replication:latest'
ports:
- 5432:5432
environment:
P_MASTER: P_MASTER
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
REPLICA_POSTGRES_USER: repuser
REPLICA_POSTGRES_PASSWORD: repuser
REPLICATE_TO: pg-slave1
REPLICATE_TO2: pg-slave2
REPLICA_NAME: r1
REPLICA_NAME2: r2
SYNCHRONOUS_COMMIT: 'off'
PGDATA: /var/lib/postgresql/data/pgdata
pg-slave1:
image: 'pg-replication:latest'
ports:
- 5433:5432
environment:
P_SLAVE1: P_SLAVE1
POSTGRES_USER: repuser
POSTGRES_PASSWORD: repuser
REPLICA_NAME: r1
REPLICATE_FROM: pg-master
PGDATA: /var/lib/postgresql/data/pgdata
pg-slave2:
image: 'pg-replication:latest'
ports:
- 5434:5432
environment:
P_SLAVE2: P_SLAVE2
POSTGRES_USER: repuser
POSTGRES_PASSWORD: repuser
REPLICA_NAME2: r2
REPLICATE_FROM: pg-master
PGDATA: /var/lib/postgresql/data/pgdata