From: Guo Xiang Tan Date: Wed, 23 Jan 2019 03:56:29 +0000 (+0800) Subject: FEATURE: Support `{{config}}` replacement to template name in `env`. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=faaa8c17ca08d22563ab0153b7f964d937f269bf;p=discourse_docker.git FEATURE: Support `{{config}}` replacement to template name in `env`. --- diff --git a/README.md b/README.md index e8762b2..4fd4a63 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,20 @@ links: Links another container to the current container. This will add `--link postgres:postgres` to the options when running the container. +#### environment variables: + +Setting environment variables to the current container. + +``` +# app.yml + +env: + DISCOURSE_DB_HOST: some-host + DISCOURSE_DB_NAME: {{config}}_discourse +``` + +The above will add `-e DISCOURSE_DB_HOST=some-host -e DISCOURSE_DB_NAME=app_discourse` to the options when running the container. + #### labels: ``` # app.yml diff --git a/launcher b/launcher index 30245c8..d45b713 100755 --- a/launcher +++ b/launcher @@ -353,7 +353,7 @@ RUBY if [ "$i" == "*ERROR." ]; then ok=0 elif [ -n "$i" ]; then - env[${#env[@]}]=$i + env[${#env[@]}]=$(echo $i | sed s/{{config}}/${config}/g) fi done <<< "$raw"