version: '2.1'
services:
  master:
    image: ${IPA_DOCKER_IMAGE}
    build: .
    cap_add:
    - ALL
    security_opt:
    - apparmor:unconfined
    - seccomp:./seccomp.json
    mem_limit: "1900m"
    volumes:
    - /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd
    - ./ipa-test-config.yaml:/root/.ipa/ipa-test-config.yaml:ro
    - ${BUILD_REPOSITORY_LOCALPATH}:${IPA_TESTS_REPO_PATH}

    networks:
    - ${IPA_NETWORK}

  replica:
    image: ${IPA_DOCKER_IMAGE}
    build: .
    cap_add:
    - ALL
    security_opt:
    - apparmor:unconfined
    - seccomp:./seccomp.json
    mem_limit: "1900m"
    volumes:
    - /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd
    networks:
    - ${IPA_NETWORK}

  client:
    image: ${IPA_DOCKER_IMAGE}
    build: .
    cap_add:
    - ALL
    security_opt:
    - apparmor:unconfined
    - seccomp:./seccomp.json
    mem_limit: "536870912"
    volumes:
    - /sys/fs/cgroup/systemd:/sys/fs/cgroup/systemd
    # nfs server
    - ./exports:/exports
    - /lib/modules:/lib/modules:ro
    networks:
    - ${IPA_NETWORK}

networks:
  ipanet:
    driver: bridge
    enable_ipv6: true
    ipam:
      driver: default
      config:
      - subnet: ${IPA_IPV6_SUBNET}
