Home > Blockchain >  I'm running docker-compose up, terminal show me: (root) Additional property mongo is not allowe
I'm running docker-compose up, terminal show me: (root) Additional property mongo is not allowe

Time:02-04

I'm practicing with Docker but I have this message in my terminal. Someone have any solution?

my docker-compose

mongo:
  image: mongo
  ports: 
  - "27017:27017"
  restart: always

web:
  build: .
  ports: 
  - "3000:3000"
  links: 
  - mongo
  command: node index.js

Terminal:

(root) Additional property mongo is not allowed

CodePudding user response:

Missing the services keyword.

version: "3.9"  # optional since v1.27.0
services:
 mongo:
  image: mongo
  ports: 
  - "27017:27017"
  restart: always
 .....

see the official doc

CodePudding user response:

Thanks, my problem was that web had the same level of services.

version: "3"
services:
  mongo:
    image: mongo
    ports: 
    - "27017:27017"
    restart: always

  web:
    build: .
    ports: 
    - "3000:3000"
    links: 
    - mongo
    command: node index.js

Thanks for all.

  •  Tags:  
  • Related