-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
102 lines (93 loc) · 4.05 KB
/
docker-compose.yaml
File metadata and controls
102 lines (93 loc) · 4.05 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# ═══════════════════════════════════════════════════════════════════
# Cluster PostgreSQL com Patroni - Arquivo Principal (Orquestrador)
# Autor: Eduardo Richard
# Versão: v2.0 (2025)
# ═══════════════════════════════════════════════════════════════════
#
# Este arquivo utiliza a diretiva 'include' do Docker Compose v2.20+
# para carregar automaticamente todos os serviços segmentados.
#
# ESTRUTURA:
# - docker-compose.etcd.yaml → Cluster ETCD (3 nós)
# - docker-compose.patroni.yaml → Cluster Patroni/PostgreSQL (3 nós)
# - docker-compose.pgpool.yaml → PgPool-II (Load Balancer)
#
# USO:
# docker compose up -d # Sobe todos os serviços
# docker compose down # Para todos os serviços
# docker compose ps # Lista status dos serviços
# docker compose logs -f [service] # Visualiza logs
#
# ═══════════════════════════════════════════════════════════════════
# ═══════════════════════════════════════════════════════════════════
# INCLUDES - Importa arquivos segmentados
# ═══════════════════════════════════════════════════════════════════
include:
- docker-compose.etcd.yaml
- docker-compose.patroni.yaml
- docker-compose.pgpool.yaml
- docker-compose.postgres_exporter.yaml
- docker-compose.pgpool_exporter.yaml
# ═══════════════════════════════════════════════════════════════════
# VOLUMES COMPARTILHADOS
# ═══════════════════════════════════════════════════════════════════
volumes:
# --- Volumes ETCD ---
etcd-1-data:
name: ${ETCD1_NAME}-data
driver: local
driver_opts:
type: none
o: bind
device: ${ETCD1_DATA_PATH}
etcd-2-data:
name: ${ETCD2_NAME}-data
driver: local
driver_opts:
type: none
o: bind
device: ${ETCD2_DATA_PATH}
etcd-3-data:
name: ${ETCD3_NAME}-data
driver: local
driver_opts:
type: none
o: bind
device: ${ETCD3_DATA_PATH}
# --- Volumes Patroni/PostgreSQL ---
patroni-postgres-1-data:
name: ${PATRONI1_NAME}-data
driver: local
driver_opts:
type: none
o: bind
device: ${PATRONI1_DATA_PATH}
patroni-postgres-2-data:
name: ${PATRONI2_NAME}-data
driver: local
driver_opts:
type: none
o: bind
device: ${PATRONI2_DATA_PATH}
patroni-postgres-3-data:
name: ${PATRONI3_NAME}-data
driver: local
driver_opts:
type: none
o: bind
device: ${PATRONI3_DATA_PATH}
# --- Volume PgPool ---
pgpool2-logs:
name: pgpool2-logs
driver: local
driver_opts:
type: none
o: bind
device: ${PGPOOL_DATA_PATH}
# ═══════════════════════════════════════════════════════════════════
# NETWORKS COMPARTILHADAS
# ═══════════════════════════════════════════════════════════════════
networks:
pg-ha-network:
name: ${NETWORK_NAME}
driver: bridge