# Docker Compose for integration testing
# Based on architecture.yml testing.levels.integration
version: '3.8'

services:
  # TLS test server for generating test traffic
  tls-server:
    build:
      context: .
      dockerfile: Dockerfile.test-server
    image: ja4sentinel-test-server:latest
    networks:
      - test-network
    ports:
      - "8443:8443"
    command: ["-port", "8443"]

  # ja4sentinel integration test runner
  ja4sentinel-test:
    build:
      context: .
      dockerfile: Dockerfile.dev
    image: ja4sentinel-dev:latest
    networks:
      - test-network
    cap_add:
      - NET_RAW
      - NET_ADMIN
    volumes:
      - ./test-results:/app/test-results
    environment:
      - JA4SENTINEL_INTERFACE=eth0
      - JA4SENTINEL_PORTS=8443
    depends_on:
      - tls-server
    command: ["make", "test-integration"]

  # Test client that generates TLS traffic
  tls-client:
    image: curlimages/curl:latest
    networks:
      - test-network
    depends_on:
      - tls-server
    command: ["curl", "-kv", "https://tls-server:8443/"]

networks:
  test-network:
    driver: bridge
