I would like to create a stack that defines 1 service over n containers on n nodes. Here are the parameters:
- Most of these containers will need to NFS mount with its host node (via the node’s DNS hostname) but some will mount an ordinary volume instead.
- Each volume should have the name “servicename_nodename” (where “nodename” is the node’s DNS hostname, as above).
- Additionally, each container should be configured with the hostname of “servicename.nodename”.
I am able to define a lengthy docker-compose.yml file that statically configures this as n services but I would really like to reduce this to 1 generalized, dynamic service. I have fiddled a bit with labels but cannot seem to get what I am after.
Is the configuration I am after even possible?