service must be a mapping, not a NoneType

Viewed 5843

The following docker-compose.yml caused ERROR: In file './docker-compose.yml', service must be a mapping, not a NoneType after using docker-compose build

version: '3.8'
services:
apollo:
  image: quay.io/gmod/docker-apollo:apollo-only
  restart: always
  links:
    - apollo_db
  ports:
    - "8888:8080"
  environment:
    - WEBAPOLLO_DB_USERNAME=postgres
    - WEBAPOLLO_DB_PASSWORD=password
    - WEBAPOLLO_DB_DRIVER="org.postgresql.Driver"
    - WEBAPOLLO_DB_DIALECT="org.hibernate.dialect.PostgresPlusDialect"
    - WEBAPOLLO_DB_URI="jdbc:postgresql://db/postgres"
  volumes:
    - ./data/jbrowse:/data
    - ./data/postgres-data:/var/lib/postgresql

apollo_db:
  image: postgres:latest
  environment:
    - POSTGRES_PASSWORD=postgres

blast:
      build: .
      container_name: blast
      environment:
        - ADMIN_USER=admin
        - ADMIN_PASS=qhYR64PBCVkeiECd7tj/lBOhc2iBybADRgyd4S9hM
        - MAX_FILE_SIZE=4000
        - CPU_NUMBER=5
      volumes:
        - ./blast-data/db:/db
        - ./blast-data/raw:/raw
        - ./blast-data/tmp:/tmp
      ports:
        - "5001:80"
        - "8095:4567"
      restart: always

I have the following versions installed:

  • Docker version 20.10.1, build 831ebea
  • docker-compose version 1.17.1, build unknown

What did I miss?

Thank you in advance

1 Answers

Looks like your services apollo, apollo_db, and blast need to be indented like this:

version: '3.8'
services:
  apollo:
    ...

  apollo_db:
    ...

  blast:
    ...

See a reference docker-compose file here

Related