How to configure Selenium Grid in docker-compose.yml (max session)

I couldn’t find how to configure the Selenium Grid with Docker Compose.

How can I set for example the maxSessions in the docker-compose.yml for a Node?

I tried the following without success:

 selenium-hub:
    image: selenium/hub
    networks:
      - mynet
    environment:
      - MAX_SESSION=4 // DOES NOT WORK
      - maxSession=4 // DOES NOT WORK
    hostname: selenium-hub
    ports:
      - "4444:4444"
  chrome:
    image: selenium/node-chrome-debug
    networks:
      - mynet
    volumes:
      - /dev/shm:/dev/shm
    depends_on:
      - selenium-hub
    environment:
      - HUB_HOST=selenium-hub
      - HUB_PORT=4444
      - MAX_SESSION=4 // DOES NOT WORK
      - maxSession=4 // DOES NOT WORK
...

Source: StackOverflow