Docker Compose file is invalid, additional properties not allowed

You are missing a services keyword, your correct .yml is:

version: '2'
services:
  config-server:
    image: ccc/config-server
    restart: always
  registration-server:
    image: ccc/registration-server
    restart: always
    ports:
      - 1111:1111

This can also happpen if one of the keys is misspelled. In my case memory was spelled incorrectly:

After fixing it:

version: "3.8"
services:
  redis:
    image: redis:alpine
    deploy:
      resources:
        limits:
          cpus: '0.50'
          memory: 50M
        reservations:
          cpus: '0.25'
          memory: 20M