Skip to content

Commit

Permalink
Update Docker Compose files for PostgreSQL and Pgpool
Browse files Browse the repository at this point in the history
  • Loading branch information
brett-onions committed Apr 25, 2024
1 parent b58f9ed commit d45061f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
14 changes: 7 additions & 7 deletions database-postgres/docker-compose-pgpool.cluster.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
version: '3.9'
version: "3.9"

services:
pgpool-1:
image: bitnami/pgpool:4.4.3
image: ${PG_POOL_IMAGE}
deploy:
placement:
constraints:
- "node.labels.name==node-1"
- "node.labels.name==${PGPOOL_1_PLACEMENT}"
replicas: 1
resources:
limits:
Expand Down Expand Up @@ -39,11 +39,11 @@ services:
PGPOOL_USER_CONF_FILE: "/config/custom_pgpool.conf"

pgpool-2:
image: bitnami/pgpool:4.4.3
image: ${PG_POOL_IMAGE}
deploy:
placement:
constraints:
- "node.labels.name==node-2"
- "node.labels.name==${PGPOOL_2_PLACEMENT}"
replicas: 1
resources:
limits:
Expand Down Expand Up @@ -76,11 +76,11 @@ services:
PGPOOL_USER_CONF_FILE: "/config/custom_pgpool.conf"

pgpool-3:
image: bitnami/pgpool:4.4.3
image: ${PG_POOL_IMAGE}
deploy:
placement:
constraints:
- "node.labels.name==node-3"
- "node.labels.name==${PGPOOL_3_PLACEMENT}"
replicas: 1
resources:
limits:
Expand Down
12 changes: 6 additions & 6 deletions database-postgres/docker-compose-postgres.cluster.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: '3.9'
version: "3.9"

services:
postgres-1:
Expand All @@ -7,7 +7,7 @@ services:
deploy:
placement:
constraints:
- "node.labels.name==node-1"
- "node.labels.name==${POSTGRES_1_PLACEMENT}"

postgres-2:
image: bitnami/postgresql-repmgr:14
Expand All @@ -23,14 +23,14 @@ services:
REPMGR_FAILOVER: ${POSTGRES_FAILOVER}
REPMGR_DEGRADED_MONITORING_TIMEOUT: ${POSTGRES_DEGRADED_MONITORING_TIMEOUT}
volumes:
- 'hapi-postgres-2-data:/bitnami/postgresql'
- "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==node-2"
- "node.labels.name==${POSTGRES_2_PLACEMENT}"
replicas: 1
resources:
limits:
Expand Down Expand Up @@ -58,14 +58,14 @@ services:
REPMGR_FAILOVER: ${POSTGRES_FAILOVER}
REPMGR_DEGRADED_MONITORING_TIMEOUT: ${POSTGRES_DEGRADED_MONITORING_TIMEOUT}
volumes:
- 'hapi-postgres-3-data:/bitnami/postgresql'
- "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==node-3"
- "node.labels.name==${POSTGRES_3_PLACEMENT}"
replicas: 1
resources:
limits:
Expand Down
2 changes: 1 addition & 1 deletion database-postgres/docker-compose-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.9"

services:
postgres-1:
image: bitnami/postgresql-repmgr:14
image: ${POSTGRES_IMAGE}
environment:
POSTGRESQL_PASSWORD: ${POSTGRESQL_PASSWORD}
REPMGR_NODE_NETWORK_NAME: postgres-1
Expand Down
8 changes: 8 additions & 0 deletions database-postgres/package-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@
"REPMGR_PRIMARY_HOST": "postgres-1",
"REPMGR_PARTNER_NODES": "postgres-1",
"REPMGR_PASSWORD": "instant101",
"POSTGRES_IMAGE": "bitnami/postgresql-repmgr:14",
"POSTGRES_1_PLACEMENT": "node-1",
"POSTGRES_2_PLACEMENT": "node-2",
"POSTGRES_3_PLACEMENT": "node-3",
"PG_POOL_IMAGE": "bitnami/pgpool:4.4.3",
"PGPOOL_1_PLACEMENT": "node-1",
"PGPOOL_2_PLACEMENT": "node-2",
"PGPOOL_3_PLACEMENT": "node-3",
"POSTGRES_REPLICA_SET": "postgres-1:5432",
"POSTGRES_CPU_LIMIT": "0",
"POSTGRES_CPU_RESERVE": "0.05",
Expand Down

0 comments on commit d45061f

Please sign in to comment.