Docker compose additional property is not allowed

I have been trying to figure out for a few weeks what this means, as whatever template I use states additional xteve is not allowed.

xteve:
    container_name: xteve
    environment:
      - PUID=1001
      - PGID=100
      - TZ=Pacific/Auckland
    ports:
      - 34400:34400
    volumes:
      - /srv/dev-disk-by-uuid-129ba3c6-37fd-4ee3-ad98-3e035875b93f/Appdata/xteve:/home/xteve/conf
      - /srv/dev-disk-by-uuid-129ba3c6-37fd-4ee3-ad98-3e0358075b93f/Appdata/xteve/temp:/tmp/xteve
    image: 'dnsforge/xteve'
    labels: 
      - autoheal=0
    healthcheck:
      test: curl -fSs http://127.0.0.1:34400 || exit 1
      start_period: 180s
      timeout: 10s
      interval: 10s
      retries: 3
    restart: unless-stopped

I have the files created for appdata/xteve/config though cannot figure out what i am doing wrong only a few weeks into using any yaml, i understand from google its maybe to do with the indentations.

Any help would be much appreciated.

This is the original template –

 xteve:
    container_name: xteve
    environment:
      - PUID=$PUID
      - PGID=$PGID
      - TZ=$TIME_ZONE
    ports:
      - 34400:34400
    volumes:
      - $PERSIST/xteve:/home/xteve/conf
      - $PERSIST/xteve/temp:/tmp/xteve
    image: 'dnsforge/xteve'
    labels: 
      - autoheal=$AUTOHEAL_RESTART
    healthcheck:
      test: curl -fSs http://127.0.0.1:34400 || exit 1
      start_period: 180s
      timeout: 10s
      interval: 10s
      retries: 3
    restart: unless-stopped

This is not a valid compose file, it lacks the top level services declaration:

services:
  xteve:
    ...

It you use the docker-compose (=v1.x) command instead of the docker compose (=v2.x) command, you might need to use the top level 'version` declaration as well. Recent versions of both shouldn’t require version anymore, older versions of v1.x do.

In case of doubt, always consult the compose specification to see what configuration keys exist and how they are supposed to be used:: Compose specification | Docker Documentation

Suggestion to Docker team - make it say this. The current error message has very low probability of putting the recipient on the correct path.

Edit: In my case it lead my astray because I didn’t notice I had just failed to copy and paste this in.