-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose-postgres.cluster.yml
84 lines (80 loc) · 2.5 KB
/
docker-compose-postgres.cluster.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
version: "3.9"
services:
postgres-1:
environment:
REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES}
deploy:
placement:
constraints:
- "node.labels.name==${POSTGRES_1_PLACEMENT}"
postgres-2:
image: ${POSTGRES_IMAGE}
environment:
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
REPMGR_NODE_NETWORK_NAME: postgres-2
REPMGR_PASSWORD: ${REPMGR_PASSWORD}
REPMGR_RECONNECT_INTERVAL: 3
REPMGR_NODE_NAME: postgres-2
REPMGR_PRIMARY_HOST: ${REPMGR_PRIMARY_HOST}
REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES}
POSTGRESQL_POSTGRES_PASSWORD: ${POSTGRESQL_PASSWORD}
REPMGR_FAILOVER: ${POSTGRES_FAILOVER}
REPMGR_DEGRADED_MONITORING_TIMEOUT: ${POSTGRES_DEGRADED_MONITORING_TIMEOUT}
volumes:
- "hapi-postgres-2-data:/bitnami/postgresql"
configs:
- target: /bitnami/postgresql/conf/conf.d/custom_postgresql.conf
source: postgresql.conf
deploy:
placement:
constraints:
- "node.labels.name==${POSTGRES_2_PLACEMENT}"
replicas: 1
resources:
limits:
cpus: ${POSTGRES_CPU_LIMIT}
memory: ${POSTGRES_MEMORY_LIMIT}
reservations:
cpus: ${POSTGRES_CPU_RESERVE}
memory: ${POSTGRES_MEMORY_RESERVE}
networks:
default:
pg_backup_net:
postgres:
postgres-3:
image: ${POSTGRES_IMAGE}
environment:
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
REPMGR_NODE_NETWORK_NAME: postgres-3
REPMGR_PASSWORD: ${REPMGR_PASSWORD}
REPMGR_RECONNECT_INTERVAL: 3
REPMGR_NODE_NAME: postgres-3
REPMGR_PRIMARY_HOST: ${REPMGR_PRIMARY_HOST}
REPMGR_PARTNER_NODES: ${REPMGR_PARTNER_NODES}
POSTGRESQL_POSTGRES_PASSWORD: ${POSTGRESQL_PASSWORD}
REPMGR_FAILOVER: ${POSTGRES_FAILOVER}
REPMGR_DEGRADED_MONITORING_TIMEOUT: ${POSTGRES_DEGRADED_MONITORING_TIMEOUT}
volumes:
- "hapi-postgres-3-data:/bitnami/postgresql"
configs:
- target: /bitnami/postgresql/conf/conf.d/custom_postgresql.conf
source: postgresql.conf
deploy:
placement:
constraints:
- "node.labels.name==${POSTGRES_3_PLACEMENT}"
replicas: 1
resources:
limits:
cpus: ${POSTGRES_CPU_LIMIT}
memory: ${POSTGRES_MEMORY_LIMIT}
reservations:
cpus: ${POSTGRES_CPU_RESERVE}
memory: ${POSTGRES_MEMORY_RESERVE}
networks:
default:
pg_backup_net:
postgres:
volumes:
hapi-postgres-2-data:
hapi-postgres-3-data: