427396653f
Adds an opt-in RedisIoAdapter (wired in main.ts when REDIS_URL is set) so socket.io room emits fan out across instances via Redis pub/sub — a client on replica B now receives messages emitted by replica A. Without REDIS_URL the in-memory adapter is kept (single-instance dev unchanged). Adds redis to docker-compose, REDIS_URL to the env contract, and smoke-realtime-cluster.mjs which proves cross-instance delivery fails without Redis and passes with it. Delivery is at-least-once at N>1; clients dedupe by message id (documented). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
34 lines
820 B
YAML
34 lines
820 B
YAML
services:
|
|
postgres:
|
|
image: pgvector/pgvector:pg16
|
|
container_name: iios-db
|
|
environment:
|
|
POSTGRES_USER: iios
|
|
POSTGRES_PASSWORD: iios
|
|
POSTGRES_DB: iios
|
|
ports:
|
|
- "5434:5432"
|
|
volumes:
|
|
- iios_postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U iios"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
# Realtime fan-out across replicas (socket.io Redis adapter). Point the service at it
|
|
# with REDIS_URL=redis://localhost:6379; without REDIS_URL the in-memory adapter is used.
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: iios-redis
|
|
ports:
|
|
- "6379:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
volumes:
|
|
iios_postgres_data:
|