72 lines
2.1 KiB
YAML
72 lines
2.1 KiB
YAML
# =============================================================================
|
|
# 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: 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:-5447}: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: messaging-redis
|
|
restart: unless-stopped
|
|
|
|
ports:
|
|
- "${REDIS_PORT:-6391}: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: messaging-postgres-data
|