version: '3.9'

services:
  qdrant:
    image: qdrant/qdrant:v1.11.3
    ports:
      - '6333:6333'
    volumes:
      - qdrant_data:/qdrant/storage

  redis:
    image: redis:7.4-alpine
    ports:
      - '6379:6379'

  mysql:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: rootpassword
      MYSQL_DATABASE: call_quality
      MYSQL_USER: appuser
      MYSQL_PASSWORD: apppassword
    ports:
      - '3306:3306'
    command: --default-authentication-plugin=mysql_native_password
    volumes:
      - mysql_data:/var/lib/mysql
      - ./infra/mysql/init.sql:/docker-entrypoint-initdb.d/init.sql:ro

  clickhouse:
    image: clickhouse/clickhouse-server:24.8
    ports:
      - '8123:8123'
      - '9000:9000'
    volumes:
      - clickhouse_data:/var/lib/clickhouse
      - ./infra/clickhouse/init.sql:/docker-entrypoint-initdb.d/init.sql:ro

  api:
    build:
      context: .
      dockerfile: Dockerfile
    env_file:
      - .env
    ports:
      - '8080:8080'
    depends_on:
      - qdrant
      - redis
      - mysql
      - clickhouse

volumes:
  qdrant_data:
  mysql_data:
  clickhouse_data:
