Compose: Providing settings using files
With the Docker Compose deployment, the MANUAL_CONFIGURATION
and LINK_SETTINGS_TO_DATA environment settings can be used to provide
settings, and possibly secrets, manually.
This takes the place of providing SETTING_ environment values.
Required settings
Note that the following settings are always required:
EXTERNAL_HOST: The hostname your users will use to connect to your Zulip server. If you’re testing on your laptop, the default oflocalhost.localdomainis great.ZULIP_ADMINISTRATOR: The email address to receive error and support emails generated by the Zulip server and its users.
Manually control just the contents of settings.py
By default, Docker Compose reads compose.yaml (such as the one checked into
the repository) and then
merges
the configuration in compose.override.yaml on top of those settings. This
lets the compose.yaml provided by this repository change as the Docker
deployment gets upgraded, while the deployment-specific parts can be placed in
compose.override.yaml.
Using compose.override.yaml to set MANUAL_CONFIGURATION and bind-mount the
settings.py file into the container, will let you fully control Zulip’s system
settings. It is easier to edit the contents this way, compared to
LINK_SETTINGS_TO_DATA (below), but it has the tradeoff that the settings are
not stored in the Docker volume alongside the secrets.
Download the default template
settings.pyfile, and save it on your Docker host system assettings.py.Edit it to set
ZULIP_ADMINISTRATORandEXTERNAL_HOST, at least. Zulip will not start unless those two values are updated.Edit other settings in the file; see the inline documentation in the file.
Decide how to store and deploy your shared secrets; the example below uses the default configuration, of storing them in a
.envfile.Edit
compose.override.yaml, and setMANUAL_CONFIGURATION: True, and add a bind volume which maps the editedsettings.pyfile into the container.services: zulip: environment: MANUAL_CONFIGURATION: True volumes: ## Update the /path/to/your/settings.py to be where `settings.py` is on your Docker host. - /path/to/your/settings.py:/etc/zulip/settings.py
You will also need to include a
secretssection to configure Compose: Secrets management.Start the container deployment with
docker compose up.If you make changes to your
settings.pyon your Docker host, or your secrets, you can update the deployment by re-runningdocker compose up.
Store settings.py in the Docker volume
Zulip’s Docker Compose deployment uses Docker volumes to persist configuration data; by default, this is just secrets and certificates, but can also include settings.
Decide how to store and deploy your shared secrets; the example below uses the default configuration, of storing them in a
.envfile.Edit
compose.override.yaml, and setMANUAL_CONFIGURATION: TrueandLINK_SETTINGS_TO_DATA: True:services: zulip: environment: MANUAL_CONFIGURATION: True LINK_SETTINGS_TO_DATA: True
You will also need to include a
secretssection to configure Compose: Secrets management.Bootstrap the volume with default settings; this command is expected to fail, since the default setting do not provide values for the required
EXTERNAL_HOSTorZULIP_ADMINISTRATORsettings. However, it will provide the scaffolding in the volume which can be easily edited.docker compose run zulip app:init
Edit the
etc-zulip/setting.pyfile in thezulipvolume, which will now have a template with potential configuration settings in it. There are a number of ways to edit a file in a Docker volume; the most straightforward is to run an editor in the container. The Zulip Docker container mounts the volume at/data, so this would look like:docker compose run --rm zulip sh -c \ "apt-get update && apt-get install -y nano && nano /data/etc-zulip/settings.py"
You will at very least need to provide values for
EXTERNAL_HOSTandZULIP_ADMINISTRATOR; Zulip will not start unless those are updated. You may also wish to edit other settings in the file; see the inline documentation in the file.Save the file and exit the editor when you’re done making changes.
Start the container deployment with
docker compose up.Updates to secrets will be propagated into the volume every time the Zulip container starts. If you make changes to
etc-zulip/zulip-secrets.confin the volume, those changes will be overwritten by any secrets which the Zulip container receives; we suggest using the Docker compose file and environment to manage secrets.If you make changes to
etc-zulip/settings.pyin the volume, or your secrets, you can update the deployment by re-runningdocker compose up.