From 231b04065e7056688bee6b828ee426f4ceb40b69 Mon Sep 17 00:00:00 2001 From: Muma David Bwalya Date: Mon, 24 Aug 2020 17:48:26 +0200 Subject: [PATCH 1/2] Update environment-variables.md I'm not sure if these are in the right place, but I think it's really important it's somewhere. Closes issue https://github.com/docker/docker.github.io/issues/11286 --- compose/environment-variables.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/compose/environment-variables.md b/compose/environment-variables.md index 6fbae3885e..daa73ba607 100644 --- a/compose/environment-variables.md +++ b/compose/environment-variables.md @@ -18,6 +18,15 @@ web: image: "webapp:${TAG}" ``` +If you have multiple environment variables, you can substitute them by providing +a path to your environment variables file. By default, the `docker-compose` +command will look for a file named `.env` in the directory you run the command. +By passing the file as an argument, you can store it anywhere and name it +appropriately, e.g (.env.ci, .env.dev, .env.prod). Passing the file path is +done using the `--env-file` option: + +``` docker-compose --env-file ./config/.env.dev up ``` + For more information, see the [Variable substitution](compose-file/index.md#variable-substitution) section in the Compose file reference. From 7d9d5f3aac7016d5696fb26848e700e24fff0940 Mon Sep 17 00:00:00 2001 From: Usha Mandya <47779042+usha-mandya@users.noreply.github.com> Date: Wed, 26 Aug 2020 13:40:21 +0100 Subject: [PATCH 2/2] Minor style updates --- compose/environment-variables.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/compose/environment-variables.md b/compose/environment-variables.md index daa73ba607..8403a42af9 100644 --- a/compose/environment-variables.md +++ b/compose/environment-variables.md @@ -22,10 +22,12 @@ If you have multiple environment variables, you can substitute them by providing a path to your environment variables file. By default, the `docker-compose` command will look for a file named `.env` in the directory you run the command. By passing the file as an argument, you can store it anywhere and name it -appropriately, e.g (.env.ci, .env.dev, .env.prod). Passing the file path is +appropriately, for example, `.env.ci`, `.env.dev`, `.env.prod`. Passing the file path is done using the `--env-file` option: -``` docker-compose --env-file ./config/.env.dev up ``` +```shell +docker-compose --env-file ./config/.env.dev up +``` For more information, see the [Variable substitution](compose-file/index.md#variable-substitution) section in the