services:
  postgresql:
    image: docker.io/postgres:17.2-alpine
    environment:
      POSTGRES_PASSWORD: test
      POSTGRES_DB: test
  postgresql2:
    image: docker.io/postgres:17.2-alpine
    environment:
      POSTGRES_PASSWORD: test2
      POSTGRES_DB: test
    command: docker-entrypoint.sh -p 5433
  mariadb:
    image: docker.io/mariadb:11.4.4
    environment:
      MARIADB_ROOT_PASSWORD: test
      MARIADB_DATABASE: test
  mariadb2:
    image: docker.io/mariadb:11.4.4
    environment:
      MARIADB_ROOT_PASSWORD: test2
      MARIADB_DATABASE: test
    command: docker-entrypoint.sh --port=3307
  not-actually-mysql:
    image: docker.io/mariadb:11.4.4
    environment:
      MARIADB_ROOT_PASSWORD: test
      MARIADB_DATABASE: test
  not-actually-mysql2:
    image: docker.io/mariadb:11.4.4
    environment:
      MARIADB_ROOT_PASSWORD: test2
      MARIADB_DATABASE: test
    command: docker-entrypoint.sh --port=3307
  mongodb:
    image: docker.io/mongo:7.0.16
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: test
  mongodb2:
    image: docker.io/mongo:7.0.16
    environment:
      MONGO_INITDB_ROOT_USERNAME: root2
      MONGO_INITDB_ROOT_PASSWORD: test2
    command: docker-entrypoint.sh --port=27018
  tests:
    image: docker.io/alpine:3.23
    environment:
      TEST_CONTAINER: true
    volumes:
      - "../..:/app"
    tmpfs:
      - "/app/borgmatic.egg-info"
      - "/app/build"
    tty: true
    working_dir: /app
    entrypoint: /app/scripts/run-full-tests
    depends_on:
      - postgresql
      - postgresql2
      - mariadb
      - mariadb2
      - mongodb
      - mongodb2
