Docker

The Docker image for ZendTo is available at hub.docker.com/r/julesfm/zendto.

Note: It provides a ZendTo service listening for http on port 80. Like similar container-based web services, it does not provide https as that role is usually left to a 2nd container of your own, running nginx as a reverse proxy. There are plenty of descriptions out there of how to quickly set up nginx as a simple reverse proxy providing the https services.

However, if you just download the latest .tgz tarball distribution of ZendTo (or the latest beta release right now), you will get all the files necessary. They are:

  • docker-compose.yml — file that "docker compose" uses. You will need to edit this to set the ZendTo version you want to install ("ZENDTO_VERSION") and your time zone ("TZ"). You will also need to choose how you supply the large "data" volume: I include working examples for NFS and SMB mounts, though you should be able to use S3, Azure, etc.
  • docker/env — the environment variables that Docker uses to do the initial configuration of your ZendTo site. You can supply any of these as "..._FILE" environment variables, where the actual value used is contained in the file: very useful for passing secrets to the container such as the SMTP server password. They work in the same way they do for the MySQL official Docker image.
  • docker/Dockerfile — this defines exactly how Docker builds the image, you shouldn't need to edit it.
  • Others — there are another 3 files in the docker sub-directory used in the construction of the Docker image, which control things like PHP settings. You probably won't need to look at them at all.

Building a new image and Starting a ZendTo Container

  1. Download and unpack ZendTo:
    # Replace 6.12-8 with the version number you want to get
    wget https://zend.to/files/ZendTo-6.12-8.tgz
    tar xzf ZendTo-6.12-8.tgz
    cd ZendTo-6.12-8
  2. Edit docker-compose.yml and docker/env appropriately for your environment and organisation
  3. Build the new image:
    docker compose build zendto
  4. Start the container:
    docker compose up -d zendto

Editing ZendTo Configuration After First Container Launch

All the configuration files for ZendTo held in

  • /opt/zendto/config
  • /opt/zendto/simplesamlphp/config
  • /opt/zendto/templates
  • /opt/zendto/www/images/email &mdash for email-logo.png
are stored in host volumes external to the container itself, so they will survive from one instance of the container to the next. The stage of configuring the preferences.php and zendto.conf files from the Docker environment variables is only done if ZendTo has not yet been configured. If you need to customise the volume mounts, edit the docker-compose.yml file to add specific mount options for those volumes.

Also, of course ZendTo's database and your users' uploaded files will all survive in the "data" volume across different instances of the container. So they're quite safe, whatever you do.

Adding Users (and using other commands in /opt/zendto/bin)

The database and all configuration files are shared across different instances of the ZendTo container, so you can run, for example the "adduser" command with
docker compose run zendto adduser ......
where ...... should be replaced with the command-line options you want for the ZendTo "adduser" command.
Note: as usual, you can run commands like adduser with no command-line options to see the usage help.

You can launch a shell or run any other command with
docker compose run zendto bash

Support

Please use the normal support channels for all queries about the Docker implementation. All suggestions are most welcome, I'm quite new to providing packages via Docker!