Environment Variables or volumes_from?

I’m migrating an application into rancher/docker that has a requirement for a large shared config file that all 20 services require access to. Now, originally we mapped this through from the host so we could vary it per environment. I’ve just finished migrating it to confd and i have a question about variables.

I effectively want to set environment variables at the stack level and have them accessible to all hosts, is this achievable? Might i be able to use the metadata service for this? I can always set them per service but it’s around 10 variables i’m setting here and would make my compose files quite messy.

My other option is to use volumes_from and have a ‘data container’ per functional environment. My issue with this though is the sidekick relationship would mean i have a ton of data containers when i only really need one.

Open to suggestions!! :smile:

Sounds like your config file should be a service :slight_smile:

  1. Prepare configuration for services.
    config_parser_service :arrow_forward: (write settings) :arrow_forward: redis_instance
  2. Use configuration across services
    redis_instance :arrow_backward: (use backend) :arrow_backward: confd (sidekick)

Interesting Idea! It would allow me to manage that information and version it inline with our apps.
Thanks Mishak!