I'm in the process of rolling out a High Availability docker swarm setup across multiple data centers, but I have a bit of a high-level question about configuration differentiation.
Say I have a single docker service, called worker
, and a HA master-master SQL database between data centers dc-a
and dc-b
. At the moment, worker
will use the same config, regardless of if it's being run on dc-a
or dc-b
.
Is there any way of differentiating the internal worker configuration or docker image, so if that if worker
is deployed to dc-a
, it runs config-a
, and if deployed to dc-b
, it runs config-b
?
The end goal is to always target the database that is local to the current data center. I know it's possible to use different datacenter DNS entries to guide database connections to the local machine, but it'd be more flexible if we could use an entirely separate config/image depending on where the worker is deployed.
Is this possible with docker swarm?