diff --git a/content/manuals/compose/how-tos/environment-variables/envvars-precedence.md b/content/manuals/compose/how-tos/environment-variables/envvars-precedence.md index de6b7a558df..0b43a481a09 100644 --- a/content/manuals/compose/how-tos/environment-variables/envvars-precedence.md +++ b/content/manuals/compose/how-tos/environment-variables/envvars-precedence.md @@ -21,6 +21,13 @@ The order of precedence (highest to lowest) is as follows: 5. Set in a container image in the [ENV directive](/reference/dockerfile.md#env). Having any `ARG` or `ENV` setting in a `Dockerfile` evaluates only if there is no Docker Compose entry for `environment`, `env_file` or `run --env`. +> [!NOTE] +> +> Compose can load both a local `.env` file and a project-directory `.env` file. +> When both files are present, the local `.env` file takes precedence over the +> project-directory `.env` file. For more information, see +> [local `.env` file versus `.env` file](variable-interpolation.md#local-env-file-versus-project-directory-env-file). + ## Simple example In the following example, a different value for the same environment variable in an `.env` file and with the `environment` attribute in the Compose file: