Adds a profile-gated compose overlay defining `postgres-federated`
(pgvector/pgvector:pg17, port 5433) and `valkey-federated`
(valkey/valkey:8-alpine, port 6380) with named volumes
(`pg_federated_data`, `valkey_federated_data`), healthchecks identical
to the base stack, and the existing `infra/pg-init` mount so the vector
extension is created automatically on first boot.
Both services are gated by `profiles: [federated]` so they never start
on a plain `docker compose up`. Usage:
docker compose -f docker-compose.federated.yml --profile federated up -d
The overlay is mutually exclusive with the base dev stack on host ports
5433/6380 (header comment documents this). Base file untouched.
Refs #460
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
61 lines
1.9 KiB
YAML
61 lines
1.9 KiB
YAML
# docker-compose.federated.yml — Federated tier overlay
|
|
#
|
|
# USAGE:
|
|
# docker compose -f docker-compose.federated.yml --profile federated up -d
|
|
#
|
|
# This file is a standalone overlay for the Mosaic federated tier.
|
|
# It is NOT an extension of docker-compose.yml — it defines its own services
|
|
# and named volumes so it can run independently of the base dev stack.
|
|
#
|
|
# IMPORTANT — HOST PORT CONFLICTS:
|
|
# The federated services bind the same host ports as the base dev stack
|
|
# (5433 for Postgres, 6380 for Valkey). You must stop the base dev stack
|
|
# before starting the federated stack on the same machine:
|
|
# docker compose down
|
|
# docker compose -f docker-compose.federated.yml --profile federated up -d
|
|
#
|
|
# pgvector extension:
|
|
# The vector extension is created automatically at first boot via
|
|
# ./infra/pg-init/01-extensions.sql (CREATE EXTENSION IF NOT EXISTS vector).
|
|
#
|
|
# Tier configuration:
|
|
# Used by `mosaic` instances configured with `tier: federated`.
|
|
# DEFAULT_FEDERATED_CONFIG points at:
|
|
# postgresql://mosaic:mosaic@localhost:5433/mosaic
|
|
|
|
services:
|
|
postgres-federated:
|
|
image: pgvector/pgvector:pg17
|
|
profiles: [federated]
|
|
ports:
|
|
- '${PG_FEDERATED_HOST_PORT:-5433}:5432'
|
|
environment:
|
|
POSTGRES_USER: mosaic
|
|
POSTGRES_PASSWORD: mosaic
|
|
POSTGRES_DB: mosaic
|
|
volumes:
|
|
- pg_federated_data:/var/lib/postgresql/data
|
|
- ./infra/pg-init:/docker-entrypoint-initdb.d:ro
|
|
healthcheck:
|
|
test: ['CMD-SHELL', 'pg_isready -U mosaic']
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
|
|
valkey-federated:
|
|
image: valkey/valkey:8-alpine
|
|
profiles: [federated]
|
|
ports:
|
|
- '${VALKEY_FEDERATED_HOST_PORT:-6380}:6379'
|
|
volumes:
|
|
- valkey_federated_data:/data
|
|
healthcheck:
|
|
test: ['CMD', 'valkey-cli', 'ping']
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
|
|
volumes:
|
|
pg_federated_data:
|
|
valkey_federated_data:
|