How to change environment variable after docker has bootstrapped site?

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.

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.

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

To amend env vars for a running container without bootstrapping.

./launcher destroy app
./launcher start app

Will do the trick most of the time.

3 Likes

Will that destroy the data stored in postgres db also?

No the database is outside the docker container.