Since you are using the exec driver you will need to have docker-compose installed in the client machine that is running the task. Then, your command needs to call the docker-compose command since the YAML file is not an executable. So it would look something like this:
That being said, I would be curious to hear what’s your use case to run Docker Compose inside Nomad. While this would probably work, there are several downsides to this approach, such as harder network and storage configuration, managing the lifecycle of individual containers etc.
Would you be able to rewrite your Docker Compose to use the docker driver instead?