Propagating Environment Variables in Docker
When running the Talisman Platform on Docker, environment-specific configurations can be managed using various approaches:
- Environment Variables defined in environment specific docker-compose.yaml
- Environment Variables propagated from host
- Integration with Vault
This guide focuses on propagating Environment Variables from the host to an integration microservice.
Steps
1. Create Environment Variable on the Host
Define the required environment variable on the host system:
2. Configure the Talisman Container
Propagate the host environment variable to the Talisman container using Docker Compose.
Add the variable via the environment
or env_file
attribute in the Talisman container configuration:
3. Set Environment Variables in Project Container
Set the configuration to include the environment variable in the project docker-compose.yaml
:
4. Use the Variable in the project
In your project routes, reference the environment variable using the {{env:ENV_NAME}} placeholder: