From 9124e41e82a871d863d308306b53c7394e868b76 Mon Sep 17 00:00:00 2001 From: Ulysses Souza Date: Fri, 19 Aug 2022 02:22:32 +0200 Subject: [PATCH] Rebase - minor edits --- compose/environment-variables.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/compose/environment-variables.md b/compose/environment-variables.md index e1c61d5b41..949df826e9 100644 --- a/compose/environment-variables.md +++ b/compose/environment-variables.md @@ -33,14 +33,10 @@ You can set default values for any environment variables referenced in the Compose file, or used to configure Compose, in an [environment file](env-file.md) named `.env`. The `.env` file path is as follows: - - Starting with `+v1.28`, `.env` file is placed at the base of the project directory + - Starting with `+v1.28`, `.env` file is placed at the base of the project directory. - Project directory can be explicitly defined with the `--file` option or `COMPOSE_FILE` - environment variable. Otherwise, it is the current working directory where the - `docker compose` command is executed (`+1.28`). - - For previous versions, it might have trouble resolving `.env` file with - `--file` or `COMPOSE_FILE`. To work around it, it is recommended to use `--project-directory`, - which overrides the path for the `.env` file. This inconsistency is addressed - in `+v1.28` by limiting the filepath to the project directory. + environment variable. Otherwise, it is the current working directory where the `docker compose` command is executed (`+1.28`). + - For previous versions, it might have trouble resolving `.env` file with `--file` or `COMPOSE_FILE`. To work around it, it is recommended to use `--project-directory`, which overrides the path for the `.env` file. This inconsistency is addressed in `+v1.28` by limiting the file path to the project directory. ```console @@ -233,7 +229,7 @@ $ docker compose exec api node ``` Having any `ARG` or `ENV` setting in a `Dockerfile` evaluates only if there is -no Docker Compose entry for `environment` or `env_file`. +no Docker Compose entry for `environment`, `env_file` or `run --env`. > Specifics for NodeJS containers >