-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
49 lines (46 loc) · 1018 Bytes
/
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
48
49
version: "3"
services:
master:
build: ./master
labels:
com.finnerds.description: "Postgres master a with 'n' standby instances"
environment:
- POSTGRES_USER=postgres
- PG_REP_USER=replication
- PG_REP_PASSWORD=replication
ports:
- 5432:5432
hostname: "master"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
default:
aliases:
- pg_cluster
standby:
build: ./standby
labels:
com.finnerds.description: "Postgres standby 'n'"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
environment:
- POSTGRES_USER=postgres
- PG_REP_USER=replication
- PG_REP_PASSWORD=replication
- PG_REP_FROM=master
ports:
- 5432
networks:
default:
aliases:
- pg_cluster
depends_on:
- master
volumes:
pg_data: