@@ -6,15 +6,15 @@ This is a container image for running [Zulip](https://zulip.com)
6
6
([ GitHub] ( https://github.com/zulip/zulip ) ) in
7
7
[ production] [ prod-overview ] . Image available from:
8
8
9
- * [ ** Docker Hub** ] ( https://hub.docker.com/r/zulip/docker-zulip ) (` docker pull zulip/docker-zulip:5.7-0 ` )
9
+ - [ ** Docker Hub** ] ( https://hub.docker.com/r/zulip/docker-zulip ) (` docker pull zulip/docker-zulip:5.7-0 ` )
10
10
11
11
Current Zulip version: ` 5.7 `
12
12
Current Docker image version: ` 5.7-0 `
13
13
14
- Project status: ** Alpha** . While this project works and is
14
+ Project status: ** Alpha** . While this project works and is
15
15
used by many sites in production, configuring is substantially more
16
16
error-prone than the [ normal Zulip installer] [ normal-install ] (which
17
- Just Works). We recommend this project if you want to host Zulip
17
+ Just Works). We recommend this project if you want to host Zulip
18
18
using Docker, but both setting up and maintaining a Zulip server is
19
19
simpler and less error-prone with the normal installer than with Docker.
20
20
@@ -41,17 +41,17 @@ next section.
41
41
### The Docker data storage model
42
42
43
43
Docker and other container systems are built around shareable
44
- container images. An image is a read-only template with instructions
45
- for creating a container. Often, an image is based on another image,
46
- with a bit of additional customization. For example, Zulip's
44
+ container images. An image is a read-only template with instructions
45
+ for creating a container. Often, an image is based on another image,
46
+ with a bit of additional customization. For example, Zulip's
47
47
` zulip-postgresql ` image extends the standard ` postgresql ` image (by
48
- installing a couple ` postgres ` extensions). And the ` zulip ` image is
48
+ installing a couple ` postgres ` extensions). And the ` zulip ` image is
49
49
built on top of a standard ` ubuntu ` image, adding all the code for a Zulip
50
50
application/web server.
51
51
52
52
Every time you boot a container based on a given image, it's like
53
53
booting off a CD-ROM: you get the exact same image (and anything
54
- written to the image's filesystem is lost). To handle persistent
54
+ written to the image's filesystem is lost). To handle persistent
55
55
state that needs to persist after the Docker equivalent of a reboot or
56
56
upgrades (like uploaded files or the Zulip database), container
57
57
systems let you configure certain directories inside the container
@@ -69,19 +69,19 @@ backed up, to ensure that Zulip's data is backed up.
69
69
70
70
To use ` docker-zulip ` , you need the following:
71
71
72
- * An installation of [ Docker] [ install-docker ] and
72
+ - An installation of [ Docker] [ install-docker ] and
73
73
[ Docker Compose] [ install-docker-compose ] or a Kubernetes runtime
74
74
engine.
75
- * We [ recommend at least 2GB of available RAM] [ prod-requirements ] for
75
+ - We [ recommend at least 2GB of available RAM] [ prod-requirements ] for
76
76
running a production Zulip server; you'll want 4GB if you're
77
- building the container (rather than using the prebuilt images). If
77
+ building the container (rather than using the prebuilt images). If
78
78
you're just testing and/or aren't expecting a lot of users/messages,
79
79
you can get away with significantly less especially for the
80
80
` postgres ` , ` memcached ` , etc. containers, because Docker makes it
81
81
easy to sharply limit the RAM allocated to the services Zulip
82
82
depends on, like redis, memcached, and postgresql (at the cost of
83
83
potential performance issues).
84
- * This project doesn't support ` docker-rootless ` ; Zulip needs root
84
+ - This project doesn't support ` docker-rootless ` ; Zulip needs root
85
85
access to set properties like the maximum number of open file
86
86
descriptions via ` ulimit ` (which is important for it to handle
87
87
thousands of connected clients).
@@ -113,62 +113,62 @@ setting environment variables declared in the `zulip -> environment`
113
113
section of the ` docker-compose.yml ` file; this image follows that
114
114
convention.
115
115
116
- ** Mandatory settings** . You must configure these settings (more
116
+ ** Mandatory settings** . You must configure these settings (more
117
117
discussion in the main [ Zulip installation docs] [ install-normal ] ):
118
118
119
- * ` SETTING_EXTERNAL_HOST ` : The hostname your users will use to
120
- connect to your Zulip server. If you're testing on your laptop,
119
+ - ` SETTING_EXTERNAL_HOST ` : The hostname your users will use to
120
+ connect to your Zulip server. If you're testing on your laptop,
121
121
the default of ` localhost.localdomain ` is great.
122
- * ` SETTING_ZULIP_ADMINISTRATOR ` : The email address to receive error
122
+ - ` SETTING_ZULIP_ADMINISTRATOR ` : The email address to receive error
123
123
and support emails generated by the Zulip server and its users.
124
124
125
- ** Mandatory settings for serious use** . Before you allow
125
+ ** Mandatory settings for serious use** . Before you allow
126
126
production traffic, you need to also set these:
127
127
128
- * ` POSTGRES_PASSWORD ` and ` SECRETS_postgres_password ` should both be a
128
+ - ` POSTGRES_PASSWORD ` and ` SECRETS_postgres_password ` should both be a
129
129
password for the Zulip container to authenticate to the Postgres
130
- container. Since you won't use this directly, you just want a long,
131
- randomly generated string. While ` SECRETS_postgres_password ` is
130
+ container. Since you won't use this directly, you just want a long,
131
+ randomly generated string. While ` SECRETS_postgres_password ` is
132
132
synced to the Zulip container on every boot, ` POSTGRES_PASSWORD ` is
133
133
only accessed by the postgres container on first boot, so if you
134
134
later want to change your postgres password after booting the
135
135
container, you'll need to either do an
136
136
[ ALTER ROLE] [ postgres-alter-role ] query inside the ` postgres `
137
137
container or rebuild the postgres database (only if you don't need
138
138
your data!).
139
- * ` RABBITMQ_DEFAULT_PASS ` and ` SECRETS_rabbitmq_password ` are similar,
139
+ - ` RABBITMQ_DEFAULT_PASS ` and ` SECRETS_rabbitmq_password ` are similar,
140
140
just for the RabbitMQ container.
141
- * ` MEMCACHED_PASSWORD ` and ` SECRETS_memcached_password ` are similar,
141
+ - ` MEMCACHED_PASSWORD ` and ` SECRETS_memcached_password ` are similar,
142
142
just for the memcached container.
143
- * ` REDIS_PASSWORD ` and ` SECRETS_redis_password ` are similar, just for
143
+ - ` REDIS_PASSWORD ` and ` SECRETS_redis_password ` are similar, just for
144
144
the Redis container.
145
- * ` SECRETS_secret_key ` should be a long (e.g. 50 characters), random
146
- string. This value is important to keep secret and constant over
145
+ - ` SECRETS_secret_key ` should be a long (e.g. 50 characters), random
146
+ string. This value is important to keep secret and constant over
147
147
time, since it is used to (among other things) sign login cookies
148
148
(so if you change this, all your users will be forcibly logged out).
149
- * ` SETTING_EMAIL_* ` : Where you configure Zulip's ability to send
149
+ - ` SETTING_EMAIL_* ` : Where you configure Zulip's ability to send
150
150
[ outgoing email] [ outgoing-email ] .
151
151
152
152
[ postgres-alter-role ] : https://www.postgresql.org/docs/9.3/static/sql-alterrole.html
153
153
154
154
** Other settings** . If an environment variable name doesn't start with
155
155
` SETTING ` or ` SECRETS ` in ` docker-compose.yml ` , it is specific to the
156
- Docker environment. Standard [ Zulip server settings] [ server-settings ]
156
+ Docker environment. Standard [ Zulip server settings] [ server-settings ]
157
157
are secrets are set using the following syntax:
158
158
159
- * ` SETTING_MY_SETTING ` will become ` MY_SETTING ` in
159
+ - ` SETTING_MY_SETTING ` will become ` MY_SETTING ` in
160
160
` /etc/zulip/settings.py `
161
- * ` SECRETS_my_secret ` will become ` my_secret ` in
161
+ - ` SECRETS_my_secret ` will become ` my_secret ` in
162
162
` /etc/zulip/zulip-secrets.conf ` .
163
163
164
164
Reading the comments in the sample
165
165
[ Zulip's settings.py file] [ prod-settings-template ] is the best way to
166
166
learn about the full set of Zulip's supported server-level settings.
167
167
168
168
Most settings in Zulip are just strings, but some are lists (etc.)
169
- which you need to encode in the YAML file. For example,
169
+ which you need to encode in the YAML file. For example,
170
170
171
- * For ` AUTHENTICATION_BACKENDS ` , you enter ` ZULIP_AUTH_BACKENDS ` as a
171
+ - For ` AUTHENTICATION_BACKENDS ` , you enter ` ZULIP_AUTH_BACKENDS ` as a
172
172
comma-separated list of the backend names
173
173
(E.g. ` "EmailAuthBackend,GitHubAuthBackend" ` ).
174
174
@@ -179,9 +179,9 @@ the multithreaded mode). This algorithm might see the host's memory, not the
179
179
docker container's memory. Set to ` QUEUE_WORKERS_MULTIPROCESS ` to ` true ` or
180
180
` false ` to override the automatic calculation.
181
181
182
- ** SSL Certificates** . By default, the image will generate a self-signed cert.
182
+ ** SSL Certificates** . By default, the image will generate a self-signed cert.
183
183
You can set ` SSL_CERTIFICATE_GENERATION: "certbot" ` within ` docker-compose.yml `
184
- to enable automatically-renewed Let's Encrypt certificates. By using certbot
184
+ to enable automatically-renewed Let's Encrypt certificates. By using certbot
185
185
here, you are agreeing to the [ Let's Encrypt
186
186
ToS] ( https://community.letsencrypt.org/tos ) .
187
187
@@ -203,12 +203,12 @@ The way the environment variables configuration process described in
203
203
the last section works is that the ` entrypoint.sh ` script that runs
204
204
when the Docker image starts up will generate a
205
205
[ Zulip settings.py file] [ server-settings ] file based on your settings
206
- every time you boot the container. This is convenient, in that you
206
+ every time you boot the container. This is convenient, in that you
207
207
only need to edit the ` docker-compose.yml ` file to configure your
208
208
Zulip server's settings.
209
209
210
210
An alternative approach is to set ` MANUAL_CONFIGURATION: "True" ` and
211
- ` LINK_SETTINGS_TO_DATA: "True" ` in ` docker-compose.yml ` . If you do that, you
211
+ ` LINK_SETTINGS_TO_DATA: "True" ` in ` docker-compose.yml ` . If you do that, you
212
212
can provide a ` settings.py ` file and a ` zulip-secrets.conf ` file in
213
213
` /opt/docker/zulip/zulip/settings/etc-zulip/ ` , and the container will use those.
214
214
@@ -221,7 +221,7 @@ docker-compose pull
221
221
docker-compose up
222
222
```
223
223
224
- This will boot the 5 containers declared in ` docker-compose.yml ` . The
224
+ This will boot the 5 containers declared in ` docker-compose.yml ` . The
225
225
` docker-compose ` command will print a bunch of output, and then
226
226
eventually hang once everything is happily booted, usually ending with
227
227
a bunch of lines like this:
@@ -236,7 +236,7 @@ You can inspect what containers are running in another shell with
236
236
` docker-compose ps ` (remember to ` cd ` into the ` docker-zulip `
237
237
directory first).
238
238
239
- If you hit ` Ctrl-C ` , that will stop your Zulip server cluster. If
239
+ If you hit ` Ctrl-C ` , that will stop your Zulip server cluster. If
240
240
you'd prefer to have the containers run in the background, you can use
241
241
` docker-compose up -d ` .
242
242
@@ -246,10 +246,10 @@ running `docker-compose build`; see also
246
246
247
247
### Connecting to your Zulip server
248
248
249
- You can now connect to your Zulip server. For example, if you set
249
+ You can now connect to your Zulip server. For example, if you set
250
250
this up on a laptop with the default port mappings and
251
251
` SETTING_EXTERNAL_HOST ` , typing ` http://localhost/ ` will take you to
252
- your server. Note that in this default scenario, (1) you'll have to
252
+ your server. Note that in this default scenario, (1) you'll have to
253
253
proceed past a self-signed SSL error, and (2) you won't be able to
254
254
login until you create an organization, but visiting the URL is a good
255
255
way to confirm that your networking configuration is working
@@ -304,7 +304,7 @@ A Kubernetes pod file is in the `kubernetes/` folder; you can run it
304
304
with ` kubectl create -f ./kubernetes/ ` .
305
305
306
306
You should read the ` docker-compose ` section above to understand how
307
- this works, since it's a very similar setup. You'll want to clone
307
+ this works, since it's a very similar setup. You'll want to clone
308
308
this repository, edit the ` zulip-rc.yml ` to configure the image, etc.
309
309
310
310
### Installing minikube for testing
@@ -327,7 +327,7 @@ https://chat.zulip.org/#narrow/stream/21-provision-help/subject/K8.20and.20Helm/
327
327
328
328
This image is not designed to make it easy to run multiple copies of
329
329
the ` zulip ` application server container (and you need to know a lot
330
- about Zulip to do this sort of thing successfully). If you're
330
+ about Zulip to do this sort of thing successfully). If you're
331
331
interested in running a high-availablity Zulip installation, your best
332
332
bet is to get in touch with the Zulip support team at
333
333
@@ -354,9 +354,9 @@ in the Docker environment (`docker-compose.yml`).
354
354
## Upgrading the Zulip container
355
355
356
356
You can upgrade your Zulip installation to any newer version of Zulip
357
- with the following instructions. At a high level, the strategy is to
357
+ with the following instructions. At a high level, the strategy is to
358
358
download a new image, stop the ` zulip ` container, and then boot it
359
- back up with the new image. When the upgraded ` zulip ` container boots
359
+ back up with the new image. When the upgraded ` zulip ` container boots
360
360
the first time, it will run the necessary database migrations with
361
361
` manage.py migrate ` .
362
362
@@ -365,7 +365,7 @@ to use `manage.py migrate` to downgrade the database schema manually.
365
365
366
366
If you are using old ` galexrt/docker-zulip ` images (from Zulip 1.8.1 or
367
367
older), you need to upgrade the postgres image from
368
- ` quay.io/galexrt/postgres-zulip-tsearchextras:latest ` . Refer to the
368
+ ` quay.io/galexrt/postgres-zulip-tsearchextras:latest ` . Refer to the
369
369
[ instructions for upgrading from the old galexrt/docker-zulip] ( #upgrading-from-the-old-galexrtdocker-zulip )
370
370
section.
371
371
@@ -382,9 +382,8 @@ section.
382
382
Note that ` docker-zulip ` did not support for Zulip's built-in
383
383
` restore-backup ` tool before Zulip 3.0.
384
384
385
- 1 . Pull the new image version, e.g. for ` 2.0.8 ` run: `docker pull
386
- zulip/docker-zulip:2.0.8-0`. We recommend always upgrading to the
387
- latest minor release within a major release series.
385
+ 1 . Pull the new image version, e.g. for ` 2.0.8 ` run: ` docker pull zulip/docker-zulip:2.0.8-0 ` . We recommend always upgrading to the
386
+ latest minor release within a major release series.
388
387
389
388
2 . Update this project to the corresponding ` docker-zulip ` version and
390
389
resolve any merge conflicts in ` docker-compose.yml ` .
@@ -394,14 +393,15 @@ latest minor release within a major release series.
394
393
the ` 2.1.2 ` release).
395
394
396
395
** Note:** Do not make any changes to the database version or
397
- volume. If there is a difference in database version, leave those
396
+ volume. If there is a difference in database version, leave those
398
397
unchanged for now, and complete that upgrade separately after the
399
398
Zulip upgrade; see [ the section below] [ pg-upgrade ] .
400
399
401
400
[ pg-upgrade ] : #upgrading-zulipzulip-postgresql-to-14
402
401
403
402
3 . Verify that your updated ` docker-compose.yml ` points to the desired image version,
404
- e.g.:
403
+ e.g.:
404
+
405
405
``` yml
406
406
zulip :
407
407
image : " zulip/docker-zulip:2.0.1-0"
@@ -428,8 +428,8 @@ docker-compose exec -u zulip zulip cat /home/zulip/deployments/current/version.p
428
428
### Upgrading from a Git repository
429
429
430
430
1 . Edit ` docker-compose.yml ` to comment out the ` image ` line, and
431
- specify the Git commit you'd like to build the zulip container from.
432
- E.g.:
431
+ specify the Git commit you'd like to build the zulip container from.
432
+ E.g.:
433
433
434
434
```
435
435
zulip:
@@ -458,7 +458,7 @@ The Docker Compose configuration for version 6.0-0 and higher default
458
458
to using PostgreSQL 14, as the previously-used PostgreSQL 10 is no
459
459
longer supported. Because the data is specific to the version of
460
460
PostgreSQL which is running, it must be dumped and re-loaded into a
461
- new volume to upgrade. PostgreSQL 14 will refuse to start if provided
461
+ new volume to upgrade. PostgreSQL 14 will refuse to start if provided
462
462
with un-migrated data from PostgreSQL 10.
463
463
464
464
The provided ` upgrade-postgresql ` tool will dump the contents of the
@@ -476,7 +476,7 @@ upgraded the major postgres version).
476
476
477
477
These instructions assume that you have not changed the default
478
478
Postgres data path (` /opt/docker/zulip/postgresql/data ` ) in your
479
- ` docker-compose.yml ` . If you have changed it, please replace all
479
+ ` docker-compose.yml ` . If you have changed it, please replace all
480
480
occurences of ` /opt/docker/zulip/postgresql/data ` with your path.
481
481
482
482
1 . Make a backup of your Zulip Postgres data dir.
@@ -485,6 +485,7 @@ occurences of `/opt/docker/zulip/postgresql/data` with your path.
485
485
` docker stop ` and not ` docker-compose stop ` ).
486
486
487
487
3 . Create a new (upgraded) Postgres container using a different data directory:
488
+
488
489
```
489
490
docker run -d \
490
491
--name postgresnew \
@@ -496,34 +497,39 @@ docker run -d \
496
497
```
497
498
498
499
4 . Use ` pg_dumpall ` to dump all data from the existing Postgres container to
499
- the new Postgres container:
500
+ the new Postgres container:
501
+
500
502
```
501
503
docker-compose exec database pg_dumpall -U postgres | \
502
504
docker exec -i postgresnew psql -U postgres
503
505
```
504
506
505
507
5 . Stop and remove both Postgres containers:
508
+
506
509
```
507
510
docker-compose rm --stop database
508
511
docker rm --stop postgresnew
509
512
```
510
513
511
514
6 . Edit your ` docker-compose.yml ` to use the
512
- ` zulip/zulip-postgresql:latest ` image for the ` database ` container
513
- (this is the default in ` zulip/docker-zulip ` ).
515
+ ` zulip/zulip-postgresql:latest ` image for the ` database ` container
516
+ (this is the default in ` zulip/docker-zulip ` ).
514
517
515
518
7 . Replace the old Postgres data directory with upgraded data directory:
519
+
516
520
```
517
521
mv /opt/docker/zulip/postgresql/data /opt/docker/zulip/postgresql/old
518
522
mv /opt/docker/zulip/postgresql/new /opt/docker/zulip/postgresql/data
519
523
```
520
524
521
525
8 . Delete the old existing containers:
526
+
522
527
```
523
528
docker-compose rm
524
529
```
525
530
526
531
9 . Start Zulip up again:
532
+
527
533
```
528
534
docker-compose up
529
535
```
@@ -535,11 +541,11 @@ That should be it. Your Postgres data has now been updated to use the
535
541
536
542
Common issues include:
537
543
538
- * Invalid configuration resulting in the ` zulip ` container not
544
+ - Invalid configuration resulting in the ` zulip ` container not
539
545
starting; check ` docker-compose ps ` to see if it started, and then
540
546
read the logs for the Zulip container to see why it failed.
541
- * A new Zulip setting not being passed through the Docker
542
- [ entrypoint.sh script] ( /entrypoint.sh ) properly. If you
547
+ - A new Zulip setting not being passed through the Docker
548
+ [ entrypoint.sh script] ( /entrypoint.sh ) properly. If you
543
549
run into this sort of problem you can work around it by specifying a
544
550
` ZULIP_CUSTOM_SETTINGS ` with one setting per line below, but please
545
551
report an issue so that we can fix this for everyone else.
@@ -557,15 +563,15 @@ documentation, so we'd love any and all feedback!
557
563
## Contributing
558
564
559
565
We love community contributions, and respond quickly to issues and
560
- PRs. Some particularly useful ways to contribute right now are:
566
+ PRs. Some particularly useful ways to contribute right now are:
561
567
562
- * Contribute to this documentation by opening issues about what
568
+ - Contribute to this documentation by opening issues about what
563
569
confused you or submitting pull requests!
564
- * Reporting bugs or rough edges!
570
+ - Reporting bugs or rough edges!
565
571
566
572
## Credits
567
573
568
- Huge thanks to everyone who has contributed. Special thanks to
574
+ Huge thanks to everyone who has contributed. Special thanks to
569
575
[ Alexander Trost] ( http://github.com/galexrt/ ) , who created
570
576
` docker-zulip ` and did a huge amount of the early work required to
571
577
make a high-quality Docker image for Zulip possible.
0 commit comments