Hello ,
I’m currently working on integrating Doppler to manage secrets and environment variables for a Docker Compose setup that involves multiple services, each with their own specific configuration requirements. I aim to use Doppler to dynamically inject environment variables without needing to explicitly list every variable in the Docker Compose files. Here are some details about my setup:
- Multiple Docker Compose Files: My application is structured with separate Docker Compose files for different components (e.g.,
docker-compose.db.yml
for databases,docker-compose.api.yml
for APIs). I’m considering how best to manage these with Doppler. - Service-Specific Variables: Each service has its own set of environment variables that are different from others, and I’d like to inject these dynamically from Doppler without explicitly listing them in the Compose files one by one, as that would be a long list.
I’ve looked into using the --mount-template
option with the Doppler run command to inject environment variables dynamically, but I’m unsure how to effectively apply this when dealing with multiple Docker Compose files and ensuring that each service gets only the variables it needs.
Questions:
- What are the best practices for using Doppler with multiple Docker Compose files to manage service-specific environment variables dynamically?
- Is there an efficient way to ensure that each Docker Compose file/service can receive its specific environment variables from Doppler without explicitly listing each variable in the Docker Compose files?
- Can anyone share examples or insights on setting up such an environment, especially any pitfalls to avoid or tips for simplification?
Any advice or examples from your experiences would be greatly appreciated as I navigate setting up this system.
Thank you!!!