4

I code on a Mac using VSCode. The folder, that includes all files is located on an external hard drive.

After writing my docker-compose.yml i use the command docker-compose up -d --build and git the error: (root) Additional property service is not allowed

I then tried first to use docker build and it worked, but as soon as i use docker-compose up, i get the same error message. What is an additional property service? Here is my docker-compose.yml

version: "3.9"

service:
  web:
    build: .
    command: python3 /eskills/manage.py runserver 0.0.0.0:8000
    volumes:
      - .:/eskill
    ports:
      - 8000:8000
    depends_on:
      - db

  db:
    image: postgres:13
    volumes:
      - postgres_data:/var/lib/postgresql/postgres_data
    environment:
      - "POSTGRES_HOST_AUTH_METHOD=trust"

volumes:
  postgres_data:

screenshot of docker-compose.yml

I tried to find all typos, checked my books, indentation, but i can not find, what i did wrong. Here on stackoverflow i found similar errors and answers, but nothing about 'property service'. Would you please see my code and let me know, what i have to change? Does it matter, that the whole folder /eskills is located on an external hard drive?

CC BY-SA 4.0

1 Answer 1

5

The reason why you can't find anything about a "service" key is that it's actually called services, not service, since you can define multiple.

Docs: https://docs.docker.com/compose/compose-file/compose-file-v3/#service-configuration-reference

CC BY-SA 4.0
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.