Compose: Using existing services
It is possible to use only parts of Zulip’s Docker Compose configuration, and use already-existing services (e.g. an external database) for other parts of the deployment.
The external database must be accessible on the Docker network that contains the rest of the Zulip services.
Create the
zulipnetwork:docker network create zulip
Update your external service (e.g. PostgreSQL server) to be accessible via the
zulipnetwork. How to do this will vary based on your deployment.Default Zulip uses PostgreSQL’s built-in full-text search and needs no extensions, but search quality depends on the dictionary files the server has available for stemming. The
zulip/zulip-postgresqlimage bundles a useful set; managed-database providers (e.g., Amazon RDS) often don’t ship those dictionaries and produce lower-quality results. To enable PGroonga for multi-language full-text search, the external server needs thepgroongaextension available.Create the user and database in the external service, if necessary.
Update
compose.override.yamlto update the list of service dependencies, remove the service you will manage externally, and use thezulipnetwork:networks: zulip: external: true services: # Removes the "database" service entirely database: !reset null redis: networks: - zulip memcached: networks: - zulip rabbitmq: networks: - zulip zulip: networks: - zulip depends_on: # "database" has been removed from this set - memcached - rabbitmq - redis environment: SETTING_REMOTE_POSTGRES_HOST: "external-database-hostname" # These are the default names, but you may need to change them # based on your database's configuration. CONFIG_postgresql__database_user: "zulip" CONFIG_postgresql__database_name: "zulip" # various settings as usual..
Test that the container can connect to the database:
docker compose run --rm app:managepy checks
Start the containers:
docker compose up