I'm trying to set up a docker-file for a selenium grid that is able to change the nodes based on an environment variable.
selenoida:
  image: "aerokube/selenoid:latest"
  container_name: selenoid
  network_mode: bridge
  ports:
    - "0.0.0.0:4444:4444"
  volumes:
    - ".:/etc/selenoid"
    - "./target:/output"
    - "/var/run/docker.sock:/var/run/docker.sock"
    - "./target:/opt/selenoid/video"
  environment:
    - "OVERRIDE_VIDEO_OUTPUT_DIR=$PWD/target"
  env_file:
    - variables.env
  command: ["-limit", "$NODES","-enable-file-upload", "-conf", "/etc/selenoid/browsers.json", "-video-output-dir", "/opt/selenoid/video"]
But looks like the command is not able to use variables. I tested with ${NODES}, NODES.
Any ideas on how to use env variables set from a file in commands?

entrypoint: [""sh", "-c", "/usr/bin/selenoid -listen :4444 -conf /etc/selenoid/browsers.json -video-output-dir /opt/selenoid/video/ -enable-file-upload -limit $${NODES}"]