---
services:
  client:
    image: docker.io/nicolaka/netshoot
    networks:
      pdns:
        ipv4_address: 10.19.2.1
    command:
      - bash
      - -c
      - "while true; do sleep 60; done"
    dns:
      - 10.19.2.10

  rec1:
    image: docker.io/powerdns/pdns-recursor-54
    user: root:root
    volumes:
      - ./recursor.yml:/etc/powerdns/recursor.yml
    networks:
      pdns:
        ipv4_address: 10.19.2.10
    environment:
      - PDNS_RECURSOR_API_KEY=mysecretapikey
      - DEBUG_CONFIG=yes

  auth1:
    image: docker.io/powerdns/pdns-auth-51
    user: root:root
    volumes:
      - ./pdns.conf:/etc/powerdns/pdns.conf
      - ./pdns-lib:/var/lib/powerdns
    networks:
      pdns:
        ipv4_address: 10.19.2.20
    environment:
      - PDNS_AUTH_API_KEY=mysecretapikey
      - DEBUG_CONFIG=yes

networks:
  pdns:
    ipam:
      config:
        - subnet: 10.19.2.0/24
          gateway: 10.19.2.254
