diff --git a/compose/compose-file.md b/compose/compose-file.md index 40dbfda3b5c5..7024e6f7d37a 100644 --- a/compose/compose-file.md +++ b/compose/compose-file.md @@ -1143,8 +1143,20 @@ string. In the example above, if `EXTERNAL_PORT` is not set, the value for the port mapping is `:5000` (which is of course an invalid port mapping, and will result in an error when attempting to create the container). -Both `$VARIABLE` and `${VARIABLE}` syntax are supported. Extended shell-style -features, such as `${VARIABLE-default}` and `${VARIABLE/foo/bar}`, are not +In the case of environment variables that are not set, it is also possible to +define default values using one of the following syntax variants: + + +* To provide a default value that will be used if `VARIABLE` is either *unset* or *empty*: + + `${VARIABLE:-default}` + +* To provide a default value only if `VARIABLE` is *empty*: + + `${VARIABLE-default}` + +Both `$VARIABLE` and `${VARIABLE}` syntax are supported. Extended +shell-style features, such as `${VARIABLE/foo/bar}`, are not supported. You can use a `$$` (double-dollar sign) when your configuration needs a literal