# Local integration test environment for Matrix/Conduit + Hermes
# Issue: #166 — proves end-to-end connectivity without public DNS
#
# Usage:
#   docker compose -f docker-compose.test.yml up -d
#   ./scripts/test-local-integration.sh
#   docker compose -f docker-compose.test.yml down -v

services:
  conduit-test:
    image: matrixconduit/conduit:latest
    container_name: conduit-test
    hostname: conduit-test
    ports:
      - "8448:6167"
    volumes:
      - conduit-test-db:/var/lib/matrix-conduit
    environment:
      CONDUIT_SERVER_NAME: "localhost"
      CONDUIT_PORT: "6167"
      CONDUIT_DATABASE_BACKEND: "rocksdb"
      CONDUIT_ALLOW_REGISTRATION: "true"
      CONDUIT_ALLOW_FEDERATION: "false"
      CONDUIT_MAX_REQUEST_SIZE: "20971520"
      CONDUIT_ENABLE_OPENID: "false"
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:6167/_matrix/client/versions"]
      interval: 5s
      timeout: 3s
      retries: 10

  element-test:
    image: vectorim/element-web:latest
    container_name: element-test
    ports:
      - "8080:80"
    environment:
      DEFAULT_HOMESERVER_URL: "http://localhost:8448"
      DEFAULT_HOMESERVER_NAME: "localhost"
    depends_on:
      conduit-test:
        condition: service_healthy

volumes:
  conduit-test-db:
