'(root) Additional property monitor is not allowed - Docker compose

i wanted to run this java app through docker: https://github.com/ByteHamster/PSE

the docker-compose.yml file looks like:

simulation:
  build: .
  dockerfile: simulationDockerfile
  environment:
    - DISPLAY
  expose:
    - 12868
    - 12869
    - 12870
    - 12871
  volumes:
    - /tmp/.X11-unix:/tmp/.X11-unix

monitor:
  build: .
  dockerfile: monitorDockerfile
  environment:
    - DISPLAY
  volumes:
    - /tmp/.X11-unix:/tmp/.X11-unix
  links:
    - simulation

when i run docker-compose build i get this error message: (root) Additional property monitor is not allowed

what is the valid yml to make this program run?

thanks guys



Solution 1:[1]

version: '2'

services:
  simulation:
    build:
      context: .
      dockerfile: simulationDockerfile
    environment:
      - DISPLAY
    expose:
      - 12868
      - 12869
      - 12870
      - 12871
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix

  monitor:
    build:
      context: .
      dockerfile: monitorDockerfile
    environment:
      - DISPLAY
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix
    links:
      - simulation

had to make the following changes so make it work

thanks @David Maze

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bananaconda