# How to change environment variable after docker has bootstrapped site?

**URL:** <https://meta.discourse.org/t/how-to-change-environment-variable-after-docker-has-bootstrapped-site/21147>\
**Category:** Self-hosting\
**Created:** [2014年十月15日 04:32 UTC](https://meta.discourse.org/t/how-to-change-environment-variable-after-docker-has-bootstrapped-site/21147 "2014-10-15T04:32:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![caogecym](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@caogecym](https://meta.discourse.org/u/caogecym)\
**Post date:** [2014年十月15日 04:32 UTC](https://meta.discourse.org/t/how-to-change-environment-variable-after-docker-has-bootstrapped-site/21147/1 "2014-10-15T04:32:08Z")

</div>

Hi all,

I’m having a situation that after restart my AWS instance, DNS name has changed. So I want to change DISCOURSE\_HOSTNAME configuration under my host’s /var/discourse/containers/standalone.yml.

I didn’t dig deep enough how unicorn manages env vars in this case. But reload the docker instance doesn’t seem to work. Because we may need to change yml config file in the future from time to time, I’m wondering how to update the variable without destroy the current docker instance.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2014年十月15日 04:33 UTC](https://meta.discourse.org/t/how-to-change-environment-variable-after-docker-has-bootstrapped-site/21147/2 "2014-10-15T04:33:59Z")

</div>

Are you saying that the dns name for your site is constantly changing? I don’t think this is a supported configuration. We expect dns names to be stable, or change rarely.

---

<div class="post-metadata">

**Author:** ![caogecym](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@caogecym](https://meta.discourse.org/u/caogecym)\
**Post date:** [2014年十月18日 00:20 UTC](https://meta.discourse.org/t/how-to-change-environment-variable-after-docker-has-bootstrapped-site/21147/3 "2014-10-18T00:20:47Z")

</div>

It doesn’t change much. I did a manual change following the following steps: [https://meta.discourse.org/t/how-to-change-the-base-url/12780/17](https://meta.discourse.org/t/how-to-change-the-base-url/12780/17)

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2014年十月19日 23:13 UTC](https://meta.discourse.org/t/how-to-change-environment-variable-after-docker-has-bootstrapped-site/21147/4 "2014-10-19T23:13:28Z")

</div>

To amend env vars for a running container without bootstrapping.

```plaintext
./launcher destroy app
./launcher start app

```

Will do the trick most of the time.

---

<div class="post-metadata">

**Author:** ![caogecym](https://avatars.discourse-cdn.com/v4/letter/c/b5ac83/32.png) [@caogecym](https://meta.discourse.org/u/caogecym)\
**Post date:** [2014年十月21日 06:23 UTC](https://meta.discourse.org/t/how-to-change-environment-variable-after-docker-has-bootstrapped-site/21147/5 "2014-10-21T06:23:09Z")

</div>

Will that destroy the data stored in postgres db also?

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2014年十月21日 06:29 UTC](https://meta.discourse.org/t/how-to-change-environment-variable-after-docker-has-bootstrapped-site/21147/6 "2014-10-21T06:29:36Z")

</div>

No the database is outside the docker container.
