-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.pgpool.yaml
More file actions
66 lines (54 loc) · 2.34 KB
/
docker-compose.pgpool.yaml
File metadata and controls
66 lines (54 loc) · 2.34 KB
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
# ═══════════════════════════════════════════════════════════════════
# Docker Compose para Pgpool-II com Configuração Externalizada
# Autor: Eduardo Richard
# Versão: v2.0 (2025)
# ═══════════════════════════════════════════════════════════════════
services:
pgpool:
image: pgpool:latest
container_name: ${PGPOOL_NAME:-pgpool}
hostname: ${PGPOOL_NAME:-pgpool}
build:
context: ./infra/pgpool
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.70'
memory: 3G
entrypoint: /opt/pgpool/bin/scripts/entrypoint.sh
command:
- "/opt/pgpool/bin/pgpool"
- "-n"
- "-f"
- "/opt/pgpool/etc/pgpool.conf"
depends_on:
patroni-postgres-1:
condition: service_healthy
patroni-postgres-2:
condition: service_healthy
patroni-postgres-3:
condition: service_healthy
healthcheck:
test:
- "CMD-SHELL"
- "PCPPASSFILE=/home/pgpool/.pcppass pcp_node_count -h localhost -p 9898 -U pcp_admin -w >/dev/null 2>&1 || exit 1"
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
volumes:
- ./infra/pgpool/scripts:/opt/pgpool/bin/scripts:ro
- ./infra/pgpool/config/pgpool.template.conf:/etc/pgpool2/pgpool.template.conf:ro
- ./infra/pgpool/config/pool_hba.conf:/opt/pgpool/etc/pool_hba.conf:ro
- pgpool2-logs:/var/log/pgpool
env_file:
- ./infra/pgpool/config/.pgpool.env
ports:
- "${PGPOOL_HOST_PORT:-5432}:5432"
- "${PGPOOL_PCP_HOST_PORT:-9898}:9898"
networks:
- pg-ha-network
# ═══════════════════════════════════════════════════════════════════
# NOTA: Volumes e Networks são gerenciados pelo docker-compose.yaml principal
# ═══════════════════════════════════════════════════════════════════