Configuration of Services
Cloud-native applications are expected to store their configuration in environment variables. Environment variables are easy to change between different platforms without source code changes. Environment variables are dynamic values that are stored in Linux-based systems and used by applications. In other words, the variables can be used to configure applications by changing their values.
For instance, assume your application uses a LOG_LEVEL
environment variable to configure what is logged. If you change the LOG_LEVEL
environment variable from INFO
to DEBUG
and restart your application, you would see more logs and be able to troubleshoot problems more easily. In addition, you can deploy the same application with different sets of environment variables to staging, testing, and production. Likewise, the method of configuring services in Docker Compose is to set environment variables for the containers.
There are three methods of defining environment...