Files
madbase/docker-compose.pillar-database.yml
Vlad Durnea a66d908eff
Some checks failed
CI / podman-build (push) Has been cancelled
CI / rust (push) Has been cancelled
chore: full stack stability and migration fixes, plus react UI progress
2026-03-18 09:01:38 +02:00

103 lines
3.0 KiB
YAML

# MadBase - Pillar: DB / State
# High-Availability PostgreSQL Cluster (Autobase)
services:
etcd1:
image: quay.io/coreos/etcd:v3.5.9
container_name: madbase_etcd1
environment:
- ETCD_NAME=etcd1
- ETCD_DATA_DIR=/etcd-data
- ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_INITIAL_ADVERTISE_PEER_URLS=http://etcd1:2380
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd1:2379
- ETCD_INITIAL_CLUSTER_TOKEN=madbase-autobase
- ETCD_INITIAL_CLUSTER=etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380
- ETCD_INITIAL_CLUSTER_STATE=new
volumes:
- etcd1_data:/etcd-data
restart: unless-stopped
etcd2:
image: quay.io/coreos/etcd:v3.5.9
container_name: madbase_etcd2
environment:
- ETCD_NAME=etcd2
- ETCD_DATA_DIR=/etcd-data
- ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_INITIAL_ADVERTISE_PEER_URLS=http://etcd2:2380
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd2:2379
- ETCD_INITIAL_CLUSTER_TOKEN=madbase-autobase
- ETCD_INITIAL_CLUSTER=etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380
- ETCD_INITIAL_CLUSTER_STATE=new
volumes:
- etcd2_data:/etcd-data
restart: unless-stopped
etcd3:
image: quay.io/coreos/etcd:v3.5.9
container_name: madbase_etcd3
environment:
- ETCD_NAME=etcd3
- ETCD_DATA_DIR=/etcd-data
- ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380
- ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379
- ETCD_INITIAL_ADVERTISE_PEER_URLS=http://etcd3:2380
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd3:2379
- ETCD_INITIAL_CLUSTER_TOKEN=madbase-autobase
- ETCD_INITIAL_CLUSTER=etcd1=http://etcd1:2380,etcd2=http://etcd2:2380,etcd3=http://etcd3:2380
- ETCD_INITIAL_CLUSTER_STATE=new
volumes:
- etcd3_data:/etcd-data
restart: unless-stopped
patroni:
image: registry.gitlab.com/postgres-ai/postgresql-autobase/patroni:3.0.2
container_name: madbase_patroni
environment:
- PATRONI_SCOPE=madbase-cluster
- PATRONI_ETCD3_HOSTS=etcd1:2379,etcd2:2379,etcd3:2379
- PATRONI_POSTGRESQL_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- db_data:/var/lib/postgresql/data
depends_on:
- etcd1
- etcd2
- etcd3
restart: unless-stopped
haproxy:
image: haproxy:2.8-alpine
container_name: madbase_haproxy
volumes:
- ./autobase-haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro
ports:
- "5432:5433"
- "6379:6379"
depends_on:
- patroni
- redis
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: madbase_redis
command: redis-server --appendonly yes
volumes:
- redis_data:/data
restart: unless-stopped
volumes:
etcd1_data:
etcd2_data:
etcd3_data:
db_data:
redis_data:
networks:
default:
name: madbase
external: true