Running piler enterprise in a containerized environment with docker-compose
In the previous blog post we learned that the traefik edge router is a handy tool to provide https connection together with Let’s Encrypt. Wouldn’t it be nice if we could run all components required by an email archive including traefik as well in a dockerized environment and still having the https certificate? We’ll do exactly like that with docker-compose.
The first step to the cloud is the ability to run in a docker container. Fortunately, piler runs on Linux, and it’s quite possible to run it in a container. In fact the dev and test environments of both piler and piler enterprise are docker based.
We will deploy the following components:
- traefik edge router to provide the http(s) inbound
- mariadb to store metadata, user data, etc.
- memcached to power some search related features
- apache tika to extract text from attachments
- piler enterprise to archive emails
- 80/tcp and 443/tcp on traefik
- 25/tcp on piler
Before we start
Before we start, you need a valid license file to run piler enterprise. Go to the Download page to register for a trial license if you need to. (Alternatively you may use the open source project’s docker image (sutoj/piler:1.3.10) as well. In this case remove the piler.lic volume reference in docker-compose.yaml).
Clone the piler-examples repo
git clone https://github.com/jsuto/piler-examples.git
Customize the configuration
Edit docker-compose.yaml and fix the following values matching your environment:
Edit traefik.yaml and replace firstname.lastname@example.org and archive.yourdomain.com with your email and archive hostname.
Be sure to fix the permissions and change the ownership of acme.json:
chown 600 acme.json
sudo chown root:root acme.json
Run the deployment
Run the following command to start the containers:
docker-compose up -d
That’s it! You have a https enabled archive running in a dockerized environment.
The setup we just did is quite flexible. Feel free to tailor it to your needs.