-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
47 lines (44 loc) · 1.32 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
44
45
46
47
version: '3.1'
services:
# we will use pgadmin4 for master database.
pgadmin4-master:
image: fenglc/pgadmin4
ports:
- 5050:5050
links:
- postgres-master:postgres-master
environment:
DEFAULT_USER: masterdatabase
DEFAULT_PASSWORD: 12345678
# we will use postgres as master database.
postgres-master:
image: nebirhos/postgres-replication
environment:
POSTGRES_USER: postgres # define credentials
POSTGRES_PASSWORD: postgres # define credentials
POSTGRES_DB: postgres # define database
ports:
- 5432:5432 # Postgres port
# we will use pgadmin4 for slave database.
pgadmin4-slave:
image: fenglc/pgadmin4
ports:
- 5060:5050
links:
- postgres-slave:postgres-slave
environment:
DEFAULT_USER: slavedatabase
DEFAULT_PASSWORD: 12345678
# we will use postgres as slave database.
postgres-slave:
image: nebirhos/postgres-replication
environment:
POSTGRES_USER: postgres # define credentials
POSTGRES_PASSWORD: postgres # define credentials
POSTGRES_DB: postgres # define database
POSTGRES_MASTER_SERVICE_HOST: postgres-master
REPLICATION_ROLE: slave
ports:
- 5433:5432 # Postgres port
links:
- postgres-master