Overview
Important
From the end of June 2023 Compose V1 won’t be supported anymore and will be removed from all Docker Desktop versions.
Make sure you switch to Compose V2 with the
docker compose
CLI plugin or by activating the Use Docker Compose V2 setting in Docker Desktop. For more information, see the Evolution of Compose
Environment variables can help you define various configuration values. They also keep your app flexible and organized.
This section covers:
- The various ways you can set environment variables in Compose.
- How environment variable precedence works.
- The correct syntax for an environment file.
- Changing pre-defined environment variables.