How to change environment variable after docker has bootstrapped site?


(Yuming Cao) #1

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.


(Jeff Atwood) #2

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.


(Yuming Cao) #3

It doesn’t change much. I did a manual change following the following steps: Discourse Meta


(Sam Saffron) #4

To amend env vars for a running container without bootstrapping.

./launcher destroy app
./launcher start app

Will do the trick most of the time.


(Yuming Cao) #5

Will that destroy the data stored in postgres db also?


(Jeff Atwood) #6

No the database is outside the docker container.