## docker-compose.sdk-test.yml
##
## Standalone server for client SDK compatibility testing.
##
## This compose file starts the rust-fafb-q server with a fixed, well-known
## test configuration. SDK test suites in any language can depend on this to
## get a predictable server with known credentials and ports.
##
## Usage:
##   # Start the server (detached)
##   docker compose -f docker-compose.sdk-test.yml up -d
##
##   # Run your SDK tests against localhost:9876 (TCP) and localhost:8080 (HTTP)
##   npm test   # or pytest, go test, cargo test, etc.
##
##   # Tear down
##   docker compose -f docker-compose.sdk-test.yml down
##
## Test fixtures (see config/config.sdk-test.toml):
##   Namespace: "test"
##     API key:     "sdk-test-key-000000000000"
##     Permissions: Subscribe, Publish, Query
##
##   Namespace: "publish-only"
##     API key:     "sdk-test-publish-only-00"
##     Permissions: Publish
##
##   Namespace: "query-only"
##     API key:     "sdk-test-query-only-0000"
##     Permissions: Query

services:
  fafb-q:
    build:
      context: .
      target: runtime
    ports:
      - "${FAFB_TCP_PORT:-9876}:9876"
      - "${FAFB_HTTP_PORT:-8080}:8080"
    tmpfs:
      - /app/data:size=128m
    environment:
      - FAFB_DATA_DIR=/app/data
      - FAFB_TCP_ADDRESS=0.0.0.0
      - FAFB_HTTP_ADDRESS=0.0.0.0
      - RUST_LOG=info
    volumes:
      - ./config/config.sdk-test.toml:/app/config/config.toml:ro
    healthcheck:
      test: ["CMD-SHELL", "curl -sf http://localhost:8080/health || exit 1"]
      interval: 2s
      timeout: 5s
      retries: 10
      start_period: 5s
