-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
44 lines (40 loc) · 1.92 KB
/
Copy pathdocker-compose.yml
File metadata and controls
44 lines (40 loc) · 1.92 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
version: '3.8'
services:
pg-master:
image: bitnami/postgresql:14
container_name: pg-master
environment:
- POSTGRESQL_REPLICATION_MODE=master
- POSTGRESQL_REPLICATION_USER=replicator
- POSTGRESQL_REPLICATION_PASSWORD=example
- POSTGRESQL_PASSWORD=example
volumes:
- master_data:/bitnami/postgresql
ports:
- '5432:5432'
networks:
- lab-net
pg-slave:
image: bitnami/postgresql:14
container_name: pg-slave
depends_on:
- pg-master
environment:
- POSTGRESQL_REPLICATION_MODE=slave
- POSTGRESQL_REPLICATION_USER=replicator
- POSTGRESQL_REPLICATION_PASSWORD=example
- POSTGRESQL_PASSWORD=example
- POSTGRESQL_MASTER_HOST=pg-master
- POSTGRESQL_MASTER_PORT_NUMBER=5432
volumes:
- slave_data:/bitnami/postgresql
ports:
- '5433:5432'
networks:
- lab-net
volumes:
master_data:
slave_data:
networks:
lab-net:
external: true