networks:
  tier1.test.local:
  tier2.test.local:
  tier3.test.local:

services:
  tier1a:
    build: tier1a/
    ports:
        - "127.0.0.3:60080:80"
        - "127.0.0.3:60443:443"
    environment:
        - PREFIX=tier1a
    volumes:
        - ../../../:/thruk:ro
        - .:/scenario:ro
        - .:/test:ro
        - ../../../var/tmp:/var/tmp:rw
    # required for strace
    #cap_add:
    #    - SYS_PTRACE
    networks:
      tier2.test.local:
      tier1.test.local:
        aliases:
          - tier1a.tier1.test.local
    hostname: tier1a
    domainname: tier1.test.local

  tier1b:
    build: tier1b/
    ports:
        - "127.0.0.3:60081:80"
        - "127.0.0.3:60444:443"
    environment:
        - PREFIX=tier1b
        - ANSIBLE_GATHER_TIMEOUT=60
    volumes:
        - ../../../:/thruk:ro
        - .:/scenario:ro
        - .:/test:ro
        - ../../../var/tmp:/var/tmp:rw
    networks:
      tier1.test.local:
        aliases:
          - tier1b.tier1.test.local
    hostname: tier1b
    domainname: tier1.test.local
    ulimits:
      nofile:
        soft: "65536"
        hard: "65536"

  tier1c:
    build: tier1c/
    ports:
        - "127.0.0.3:60082:80"
        - "127.0.0.3:60445:443"
    environment:
        - PREFIX=tier1c
        - ANSIBLE_GATHER_TIMEOUT=60
    volumes:
        - ../../../:/thruk:ro
        - .:/scenario:ro
        - .:/test:ro
        - ../../../var/tmp:/var/tmp:rw
    networks:
      tier1.test.local:
        aliases:
          - tier1c.tier1.test.local
    hostname: tier1c
    domainname: tier1.test.local
    ulimits:
      nofile:
        soft: "65536"
        hard: "65536"

  tier1d:
    build: tier1d/
    ports:
        - "127.0.0.3:60083:80"
        - "127.0.0.3:60446:443"
    environment:
        - PREFIX=tier1d
    volumes:
        - ../../../:/thruk:ro
        - .:/scenario:ro
        - .:/test:ro
        - ../../../var/tmp:/var/tmp:rw
    networks:
      tier2.test.local:
      tier1.test.local:
        aliases:
          - tier1d.tier1.test.local
    hostname: tier1d
    domainname: tier1.test.local


  tier2a:
    build: tier2a/
    environment:
        - PREFIX=tier2a
    volumes:
        - ../../../:/thruk:ro
        - .:/scenario:ro
        - .:/test:ro
        - ../../../var/tmp:/var/tmp:rw
    networks:
      tier3.test.local:
      tier2.test.local:
        aliases:
          - tier2a.tier2.test.local
    hostname: tier2a
    domainname: tier2.test.local

  tier2b:
    build: tier2b/
    environment:
        - PREFIX=tier2b
        - ANSIBLE_GATHER_TIMEOUT=60
    volumes:
        - ../../../:/thruk:ro
        - .:/scenario:ro
        - .:/test:ro
        - ../../../var/tmp:/var/tmp:rw
    networks:
      tier2.test.local:
        aliases:
          - tier2b.tier2.test.local
    hostname: tier2b
    domainname: tier2.test.local
    ulimits:
      nofile:
        soft: "65536"
        hard: "65536"

  tier2c:
    build: tier2c/
    environment:
        - PREFIX=tier2c
    volumes:
        - ../../../:/thruk:ro
        - .:/scenario:ro
        - .:/test:ro
        - ../../../var/tmp:/var/tmp:rw
    networks:
      tier2.test.local:
        aliases:
          - tier2c.tier2.test.local
    hostname: tier2c
    domainname: tier2.test.local

  tier2d:
    build: tier2d/
    environment:
        - PREFIX=tier2d
        - ANSIBLE_GATHER_TIMEOUT=60
    volumes:
        - ../../../:/thruk:ro
        - .:/scenario:ro
        - .:/test:ro
        - ../../../var/tmp:/var/tmp:rw
    networks:
      tier2.test.local:
        aliases:
          - tier2d.tier2.test.local
    hostname: tier2d
    domainname: tier2.test.local
    ulimits:
      nofile:
        soft: "65536"
        hard: "65536"

  tier2e:
    build: tier2e/
    environment:
        - PREFIX=tier2e
        - ANSIBLE_GATHER_TIMEOUT=60
    volumes:
        - ../../../:/thruk:ro
        - .:/scenario:ro
        - .:/test:ro
        - ../../../var/tmp:/var/tmp:rw
    networks:
      tier2.test.local:
        aliases:
          - tier2e.tier2.test.local
    hostname: tier2e
    domainname: tier2.test.local
    ulimits:
      nofile:
        soft: "65536"
        hard: "65536"

  tier3a:
    build: tier3a/
    environment:
        - PREFIX=tier3a
    volumes:
        - ../../../:/thruk:ro
        - .:/scenario:ro
        - .:/test:ro
        - ../../../var/tmp:/var/tmp:rw
    networks:
      tier3.test.local:
        aliases:
          - tier3a.tier3.test.local
    hostname: tier3a
    domainname: tier3.test.local

  tier3b:
    build: tier3b/
    environment:
        - PREFIX=tier3b
    volumes:
        - ../../../:/thruk:ro
        - .:/scenario:ro
        - .:/test:ro
        - ../../../var/tmp:/var/tmp:rw
    networks:
      tier3.test.local:
        aliases:
          - tier3b.tier3.test.local
    hostname: tier3b
    domainname: tier3.test.local

  tier3c:
    build: tier3c/
    environment:
        - PREFIX=tier3c
    volumes:
        - ../../../:/thruk:ro
        - .:/scenario:ro
        - .:/test:ro
        - ../../../var/tmp:/var/tmp:rw
    networks:
      tier3.test.local:
        aliases:
          - tier3c.tier3.test.local
    hostname: tier3c
    domainname: tier3.test.local
