Overview
Important
Docker's documentation refers to and describes Compose V2 functionality.
Effective July 2023, Compose V1 stopped receiving updates and is no longer in new Docker Desktop releases. Compose V2 has replaced it and is now integrated into all current Docker Desktop versions. For more information, see Migrate to Compose V2.
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.