Files
inventory-flo-debezium-nats/compose.yml
T
2026-08-11 20:42:44 +01:00

89 lines
1.9 KiB
YAML

services:
postgres:
image: postgres:18-alpine
container_name: cdc_postgres
command:
- postgres
- -c
- wal_level=logical
- -c
- max_wal_senders=10
- -c
- max_replication_slots=10
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "5453:5432"
volumes:
- postgres_data:/var/lib/postgresql
- ./postgres/init:/docker-entrypoint-initdb.d:ro,Z
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 5s
timeout: 5s
retries: 20
nats:
image: nats:2
container_name: cdc_nats
command:
- "--debug"
- "--http_port=8222"
- "--js"
- "--store_dir=/data"
ports:
- "4222:4222"
- "8222:8222"
volumes:
- nats_data:/data
debezium:
image: quay.io/debezium/server:3.5.2.Final
container_name: cdc_debezium
volumes:
- ./application.properties:/debezium/config/application.properties:ro,Z
- debezium_data:/debezium/data
depends_on:
postgres:
condition: service_healthy
nats:
condition: service_started
seed:
image: postgres:18-alpine
container_name: cdc_postgres_seed
profiles: ["tools"]
environment:
PGHOST: postgres
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: postgres
volumes:
- ./scripts:/scripts:ro,Z
entrypoint: ["sh", "/scripts/seed.sh"]
depends_on:
postgres:
condition: service_healthy
debezium:
condition: service_started
nats-cli:
image: natsio/nats-box:latest
container_name: cdc_nats_cli
profiles: ["tools"]
environment:
NATS_URL: nats://nats:4222
volumes:
- ./scripts:/scripts:ro,Z
entrypoint: ["sh"]
depends_on:
nats:
condition: service_started
volumes:
postgres_data:
nats_data:
debezium_data: