-
Notifications
You must be signed in to change notification settings - Fork 396
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
90 lines (83 loc) · 1.87 KB
/
docker-compose.yaml
File metadata and controls
90 lines (83 loc) · 1.87 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
# Shared base configuration for Postgres nodes. Avoids duplication and keeps all nodes consistent.
# Note: This is a template, not a service.
x-node: &node
image: citusdata/pg_auto_failover:v2.0-pg14
volumes:
- /var/lib/postgres
environment:
PGDATA: /var/lib/postgres/pgaf
PGUSER: tutorial
PGDATABASE: tutorial
PG_AUTOCTL_HBA_LAN: true
PG_AUTOCTL_AUTH_METHOD: "trust"
PG_AUTOCTL_SSL_SELF_SIGNED: true
PG_AUTOCTL_MONITOR: "postgresql://autoctl_node@monitor/pg_auto_failover"
expose:
- 5432
networks:
- aligned-network
volumes:
postgres_data:
networks:
aligned-network:
name: aligned-network
driver: bridge
name: aggregation-mode
services:
postgres:
image: postgres
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- PGDATA=/var/lib/postgresql/data/pgdata
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- 5435:5432
networks:
- aligned-network
adminer:
image: adminer
restart: always
depends_on:
- postgres
ports:
- 8090:8080
networks:
- aligned-network
monitor:
image: citusdata/pg_auto_failover:v2.0-pg14
volumes:
- /var/lib/postgres
environment:
PGDATA: /var/lib/postgres/pgaf
PG_AUTOCTL_SSL_SELF_SIGNED: true
ports:
- "5436:5432"
command: |
pg_autoctl create monitor --auth trust --run
networks:
- aligned-network
node1:
<<: *node
hostname: node1
command: >
pg_autoctl create postgres
--name node1
--ssl-self-signed
--ssl-mode require
--auth trust
--pg-hba-lan
--run
node2:
<<: *node
hostname: node2
command: >
pg_autoctl create postgres
--name node2
--ssl-self-signed
--ssl-mode require
--auth trust
--pg-hba-lan
--run