sockudo 2.9.2

A simple, fast, and secure WebSocket server for real-time applications.
Documentation
# =============================================================================
# Sockudo Lightweight Test Services
# =============================================================================

name: sockudo-test

services:
  # Single Redis instance
  redis-test:
    image: redis:7-alpine
    ports:
      - "16379:6379"
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 15s
      timeout: 5s
      retries: 2
      start_period: 5s
    networks:
      - sockudo-network
    mem_limit: 128m
    cpus: "0.5"

  # Redis Cluster using grokzen/redis-cluster image (designed for testing)
  redis-cluster:
    image: grokzen/redis-cluster:7.0.10
    environment:
      IP: 0.0.0.0
      INITIAL_PORT: 7003
      MASTERS: 3
      SLAVES_PER_MASTER: 0
    ports:
      - "7003:7003"
      - "7001:7001"
      - "7002:7002"
    networks:
      - sockudo-network
    mem_limit: 256m
    cpus: "0.5"

  # Minimal NATS Cluster (2 nodes)
  nats-1:
    image: nats:alpine
    ports:
      - "14222:4222"
      - "18222:8222" # HTTP monitoring
    command: |
      --name nats-1
      --cluster_name NATS
      --cluster nats://0.0.0.0:6222
      --routes nats://nats-2:6222
      --http_port 8222
    networks:
      - sockudo-network
    mem_limit: 128m
    cpus: "0.25"

  nats-2:
    image: nats:alpine
    ports:
      - "14223:4222"
      - "18223:8222" # HTTP monitoring
    command: |
      --name nats-2
      --cluster_name NATS
      --cluster nats://0.0.0.0:6222
      --routes nats://nats-1:6222
      --http_port 8222
    networks:
      - sockudo-network
    mem_limit: 128m
    cpus: "0.25"

  # Development MySQL with sample data
  mysql-test:
    image: mysql:8.0
    environment:
      - MYSQL_ROOT_PASSWORD=root123
      - MYSQL_DATABASE=sockudo
      - MYSQL_INITDB_SKIP_TZINFO=1
    command: --bind-address=0.0.0.0 --default-authentication-plugin=mysql_native_password --innodb-buffer-pool-size=128M --max-connections=50 --performance-schema=OFF
    ports:
      - "13306:3306"
    volumes:
      - mysql-test-data:/var/lib/mysql
      - ./sql/init-sql-docker.sql:/docker-entrypoint-initdb.d/01-init-sql.sql:ro
      - ./sql/init-test.sql:/docker-entrypoint-initdb.d/02-init-test.sql:ro
    networks:
      - sockudo-network
    mem_limit: 512m
    cpus: "0.5"
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-proot123"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s

  # ScyllaDB for testing
  scylladb-test:
    image: scylladb/scylla:2025.3
    command: --smp 1 --memory 512M --overprovisioned 1 --developer-mode=1
    ports:
      - "19042:9042" # CQL port
      - "10000:10000" # REST API
    networks:
      - sockudo-network
    mem_limit: 1024m
    cpus: "1.0"
    healthcheck:
      test: ["CMD-SHELL", "nodetool status | grep -E '^UN'"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 60s
    volumes:
      - scylladb-test-data:/var/lib/scylla/data
      - scylladb-test-commitlog:/var/lib/scylla/commitlog
      - scylladb-test-hints:/var/lib/scylla/hints
      - scylladb-test-view-hints:/var/lib/scylla/view_hints

  # PostgreSQL test instance
  postgres-test:
    image: postgres:15-alpine
    environment:
      - POSTGRES_PASSWORD=postgres123
      - POSTGRES_USER=postgres
      - POSTGRES_DB=sockudo_test
    ports:
      - "15432:5432"
    volumes:
      - postgres-test-data:/var/lib/postgresql/data
      - ./sql/init-postgres-test.sql:/docker-entrypoint-initdb.d/01-init-postgres-test.sql:ro
    networks:
      - sockudo-network
    mem_limit: 256m
    cpus: "0.5"
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 10s

networks:
  sockudo-network:
    driver: bridge

volumes:
  mysql-test-data:
    driver: local
  scylladb-test-data:
    driver: local
  scylladb-test-commitlog:
    driver: local
  scylladb-test-hints:
    driver: local
  scylladb-test-view-hints:
  postgres-test-data:
    driver: local