name: ksf-tests

services:
  mysql80:
    image: mysql:8.0.35
    # Rollback tests create failure-injection triggers as the test database user.
    command: ["--skip-log-bin"]
    environment:
      MYSQL_DATABASE: ksf_tests
      MYSQL_USER: ksf
      MYSQL_PASSWORD: ksf
      MYSQL_ROOT_PASSWORD: root
    ports:
      - "127.0.0.1:13380:3306"
    healthcheck:
      test: ["CMD", "mysql", "--host=127.0.0.1", "--user=ksf", "--password=ksf", "ksf_tests", "--execute=SELECT 1"]
      interval: 2s
      timeout: 5s
      retries: 60
      start_period: 20s

  mysql57:
    image: mysql:5.7.44
    command: ["--skip-log-bin"]
    environment:
      MYSQL_DATABASE: ksf_tests
      MYSQL_USER: ksf
      MYSQL_PASSWORD: ksf
      MYSQL_ROOT_PASSWORD: root
    ports:
      - "127.0.0.1:13357:3306"
    healthcheck:
      test: ["CMD", "mysql", "--host=127.0.0.1", "--user=ksf", "--password=ksf", "ksf_tests", "--execute=SELECT 1"]
      interval: 2s
      timeout: 5s
      retries: 60
      start_period: 20s

  mariadb:
    image: mariadb:10.11
    environment:
      MARIADB_DATABASE: ksf_tests
      MARIADB_USER: ksf
      MARIADB_PASSWORD: ksf
      MARIADB_ROOT_PASSWORD: root
    ports:
      - "127.0.0.1:13306:3306"
    healthcheck:
      test: ["CMD", "mariadb", "--host=127.0.0.1", "--user=ksf", "--password=ksf", "ksf_tests", "--execute=SELECT 1"]
      interval: 2s
      timeout: 5s
      retries: 60
      start_period: 20s
