Document how to restart after changing environment variables
Hi, consider I'm accessing the zulip container with something like
sudo docker-compose exec zulip /bin/bash
And I want to f.e edit /etc/zulip/settings.py, currently the two methods I had were:
- Add a working debian souce and apt-get it myself - takes a bit more, easily overriden
-
docker cpout -> edit the file ->docker cpin.
Not really comfortable, the second one is more reliable, but the best thing would be to easily edit the files with vim when you have an open bash in the container.
Yeah, we should include this; it won't add much to the container image size and make life a lot easier for manual inspection/debugging.
@galexrt do you have thoughts on what folks normally do for editors in an image like this? They're pretty small in disk size compared to the rest of the image, so possibly we should just include them, but I'm curious whether folks try to do it under an option or something.
@timabbott Normally the configs would not be edited inside the container, that is what the /data/settings directory is for, see https://github.com/zulip/docker-zulip/blob/master/entrypoint.sh#L79-L91.
I'm against installing any editor, as the config can already be edited from outside the container when LINK_SETTINGS_TO_DATA is set to True, https://github.com/zulip/docker-zulip/blob/master/entrypoint.sh#L49.
i think the LINK_SETTINGS_TO_DATA is just not documented yet.
@galexrt definitely not document. I would much rather have it linked outside and edit it how I like than having to vim inside the container. But compared to not being able to edit without docker cping, then vim is a better solution.
Can you elaborate on the env var here a it?
@gioragutt If you set LINK_SETTINGS_TO_DATA: "True", your data dir on the host will have a settings directory in which you can edit the settings.py.
Amazing. BTW, using docker-compose, what's your suggested method of restarting the server after changing env vars, without losing data? I do it every now and then, always hope mother gets ruined, and yesterday I fucked my server up and lost some data trying to make it work again.
Just use docker-compose stop && docker-compose rm and to start again docker-compose up -d.
The container is currently for being started and "on stop" being deleted and recreated.
Are you talking about the Zulip server?
Yes. So the step I'm not doing is the rm.
This should be added to the docs maybe. "How to restart the server after environment variables changes". Just to be sure, the rm does not delete the volume data, right?
Agreed, I'm reopening this as a documentation issue for covering that.
@gioragutt docker-compose rm only removes the containers, as long as you have specified volumes for the data in the docker-compose.yml you are good.