# ============================================================================= # MESSAGING: Database Infrastructure # ============================================================================= # # PostgreSQL for messaging threads, messages, and tags. # Redis for WebSocket adapter (Socket.IO scaling) and pub/sub. # # Usage: # docker-compose up -d # Start postgres + redis # docker-compose logs -f # Follow logs # docker-compose down # Stop # # ============================================================================= services: # ============================================================================= # DATABASE: PostgreSQL for messaging data # ============================================================================= messaging-postgres: image: postgres:16-alpine container_name: lilith-messaging-postgres restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER:-messaging} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-devpassword} POSTGRES_DB: ${POSTGRES_DB:-lilith_messaging} ports: - "${POSTGRES_PORT:-25447}:5432" volumes: - messaging-postgres-data:/var/lib/postgresql/data healthcheck: test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-messaging} -d ${POSTGRES_DB:-lilith_messaging}'] interval: 10s timeout: 5s retries: 5 logging: driver: json-file options: max-size: "100m" max-file: "5" # ============================================================================= # CACHE: Redis for WebSocket adapter and pub/sub # ============================================================================= messaging-redis: image: redis:7.4-alpine container_name: lilith-messaging-redis restart: unless-stopped ports: - "${REDIS_PORT:-26391}:6379" healthcheck: test: ['CMD', 'redis-cli', 'ping'] interval: 10s timeout: 5s retries: 5 logging: driver: json-file options: max-size: "100m" max-file: "5" volumes: messaging-postgres-data: name: lilith-${LILITH_ENV:-dev}-messaging-postgres-data