forked from code1br/heroku-buildpack-pgpool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
46 lines (46 loc) · 1.3 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
version: '3.8'
services:
leader:
image: bitnami/postgresql:13.5.0
ports:
- 5433:5432
volumes:
- leader_data:/bitnami/postgresql
environment:
- POSTGRESQL_REPLICATION_MODE=master
- POSTGRESQL_REPLICATION_USER=postgres
- POSTGRESQL_REPLICATION_PASSWORD=s3cret
- POSTGRESQL_PASSWORD=s3cret
- POSTGRESQL_DATABASE=test_db
follower:
image: bitnami/postgresql:13.5.0
ports:
- 5434:5432
depends_on:
- leader
environment:
- POSTGRESQL_REPLICATION_MODE=slave
- POSTGRESQL_REPLICATION_USER=postgres
- POSTGRESQL_REPLICATION_PASSWORD=s3cret
- POSTGRESQL_MASTER_HOST=leader
- POSTGRESQL_PASSWORD=s3cret
pgpool:
image: bitnami/pgpool:4.3.3
ports:
- 5435:5432
depends_on:
- leader
environment:
- PGPOOL_BACKEND_NODES=0:leader:5432:4:primary:ALWAYS_PRIMARY,1:follower:5432:6:replica
- PGPOOL_POSTGRES_USERNAME=postgres
- PGPOOL_POSTGRES_PASSWORD=s3cret
- PGPOOL_ADMIN_USERNAME=admin
- PGPOOL_ADMIN_PASSWORD=s3cret
- PGPOOL_ENABLE_LOAD_BALANCING=yes
- PGPOOL_ENABLE_STATEMENT_LOAD_BALANCING=yes
- PGPOOL_NUM_INIT_CHILDREN=10
- PGPOOL_MAX_POOL=1
- PGPOOL_SR_CHECK_USER=postgres
- PGPOOL_SR_CHECK_PASSWORD=s3cret
volumes:
leader_data: