You could do multiple tasks in an app, and use an environment variable to make the instances unique. Nomad will natively take care of respawning the service if it stops.
Note all services in a task will be run on the same host. If you want to have each instance run on a unique host, do 1 task per group.
Lovely stuff spuder, is there perhaps a way to capitalise on ${NOMAD_ALLOC_INDEX} and have it select from that index in env if it’s possible to use env as an array?
the env block is for the process “environment”. It is not an arbitrary data structure. As such I doubt (am pretty sure) that you can’t use “env” like that. It would have to be “key=value” syntax.