41 lines
1.4 KiB
YAML
41 lines
1.4 KiB
YAML
services:
|
|
etcd:
|
|
image: quay.io/coreos/etcd:v3.5.17
|
|
restart: unless-stopped
|
|
environment:
|
|
- ETCD_NAME=${NODE_NAME}
|
|
- ETCD_INITIAL_ADVERTISE_PEER_URLS=http://${NODE_IP}:2380
|
|
- ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380
|
|
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
|
|
- ETCD_ADVERTISE_CLIENT_URLS=http://${NODE_IP}:2379
|
|
- ETCD_INITIAL_CLUSTER=node1=http://${NODE1_IP}:2380,node2=http://${NODE2_IP}:2380,node3=http://${NODE3_IP}:2380
|
|
- ETCD_INITIAL_CLUSTER_STATE=new
|
|
- ETCD_INITIAL_CLUSTER_TOKEN=patroni-cluster
|
|
- ETCD_DATA_DIR=/etcd-data
|
|
ports:
|
|
- "2379:2379"
|
|
- "2380:2380"
|
|
volumes:
|
|
- /data/compose/postgrecluster/etcd_data:/etcd-data
|
|
|
|
patroni:
|
|
image: ghcr.io/zalando/spilo-17:4.0-p3
|
|
restart: unless-stopped
|
|
environment:
|
|
- SCOPE=authentik-cluster
|
|
- PGVERSION=17
|
|
- SPILO_PROVIDER=local
|
|
- POD_IP=${NODE_IP}
|
|
- PATRONI_NAME=${NODE_NAME}
|
|
- ETCD3_HOSTS=${NODE1_IP}:2379,${NODE2_IP}:2379,${NODE3_IP}:2379
|
|
- PATRONI_SUPERUSER_USERNAME=postgres
|
|
- PATRONI_SUPERUSER_PASSWORD=${POSTGRES_SUPERUSER_PASSWORD}
|
|
- PATRONI_REPLICATION_USERNAME=replicator
|
|
- PATRONI_REPLICATION_PASSWORD=${POSTGRES_REPLICATION_PASSWORD}
|
|
ports:
|
|
- "5432:5432"
|
|
- "8008:8008"
|
|
volumes:
|
|
- /data/compose/postgrecluster/pg_data:/home/postgres/pgdata
|
|
depends_on:
|
|
- etcd |