Correct syntax for a macvlan network in a docker-compose.yaml file - help needed

Hi all

I am trying to configure the docker-compose.yaml file for pi-hole, but I keep getting “Additional property xxxxx is not allowed” errors

services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    restart: unless-stopped
    ports:
      - 53:53/tcp
      - 53:53/udp
      - 67:67/udp
      - 8080:80/tcp
    environment:
      TZ: 'Europe/Dublin'
      WEBPASSWORD: '********'
    volumes:
      - './pihole:/etc/pihole'
      - './pihole:/etc/dnsmasq.d'
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
    cap_add:
      - NET_ADMIN # Required if you are using Pi-hole as your DHCP server, else not needed
    networks:
      - pi-hole-net
    labels:
      - "com.centurylinklabs.watchtower.enable=true"

  networks:
    pi-hole-net:
      driver: macvlan
      driver_opts:
        parent: wlp2s0 #**Change this to your interface
      ipam:
        driver: default
        config:
          - subnet: 192.168.1.0/24     #**Your network subnet
            ip_range: 192.168.1.21/32  #**ip for pihole container
            gateway: 192.168.1.1       #**Your network gateway

Where am I going wrong please ?

Thanks in advance

I wonder why you would hide the only part of the error message which would help someone to help you. I don’t know any property called “xxxxx”. But if this is the whole compose file, the “services” block is missing

services:
  pihole:

and the networks keyword at the end should not be indented at all.

Ah sorry - “services.networks Additional property pi-hole-net is not allowed”

But I have loads of different configs in this one single docker-compose-yaml file, so yes, I have
services:
at the very top - OP updated for clarity

Thanks - all sorted. That was indeed the issue