services:
  bird-rpki-client:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        BIRD_VERSION: "${RPKI_BIRD_VERSION:-3.2.1}"
    container_name: bird-rpki-client
    restart: unless-stopped
    environment:
      BIRD_CONFIG_TEMPLATE_PATH: "${RPKI_BIRD_CONFIG_TEMPLATE_PATH:-/config/bird.conf.template}"

      RPKI_HOST: "${RPKI_BIRD_RPKI_HOST:-rpki-rtr-tcp}"
      RPKI_PORT: "${RPKI_BIRD_RPKI_PORT:-323}"

      OBSERVE_PROTO: "${RPKI_BIRD_OBSERVE_PROTO:-rpki_tcp}"
      OBSERVE_MODE: "${RPKI_BIRD_OBSERVE_MODE:-interval}"
      OBSERVE_DEBOUNCE_SECS: "${RPKI_BIRD_OBSERVE_DEBOUNCE_SECS:-1}"
      OBSERVE_INTERVAL: "${RPKI_BIRD_OBSERVE_INTERVAL:-30}"

      OBSERVE_ASPA_TABLE: "${RPKI_BIRD_OBSERVE_ASPA_TABLE:-rtr_aspa}"
      OBSERVE_ROA4_TABLE: "${RPKI_BIRD_OBSERVE_ROA4_TABLE:-rtr_roa_v4}"
      OBSERVE_ROA6_TABLE: "${RPKI_BIRD_OBSERVE_ROA6_TABLE:-rtr_roa_v6}"

      OBSERVE_ASPA_COUNT: "${RPKI_BIRD_OBSERVE_ASPA_COUNT:-3}"
      OBSERVE_ROA4_COUNT: "${RPKI_BIRD_OBSERVE_ROA4_COUNT:-3}"
      OBSERVE_ROA6_COUNT: "${RPKI_BIRD_OBSERVE_ROA6_COUNT:-3}"

      SHOW_ASPA: "${RPKI_BIRD_SHOW_ASPA:-1}"
      SHOW_ROA4: "${RPKI_BIRD_SHOW_ROA4:-1}"
      SHOW_ROA6: "${RPKI_BIRD_SHOW_ROA6:-1}"
    volumes:
      - ./bird.conf.template:/config/bird.conf.template:ro
      - ${RPKI_BIRD_LOG_HOST_DIR:-../../logs/bird}:/app/logs
    networks:
      - rpki_net

networks:
  rpki_net:
    name: rpki_net
    driver: bridge
