How to run multiple Minio servers with Træfɪk

Træfɪk is a modern reverse proxy also written in Go. It
supports multiple ways to get configured, this cookbook will explain how you
can setup multiple Minio instances via Docker which you can access on different
sub-domains through Træfɪk.

1. Prerequisites

2. Steps

Fetch, configure and launch Træfɪk

First of all you should create a configuration file for Træfɪk to enable Let's
Encrypt and to configure the Docker backend. Incoming traffic via HTTP gets
automatically redirected to HTTPS and the certificates are getting created on
demand by the integrated Let's Encrypt support.

Beside the configuration we should also touch the acme.json file, this file
is the storage for the generated certificates. This file will also store the
private keys, so you should set proper permissions to make sure not everybody
can read the configuration.

touch acme.json
chmod 640 acme.json

With those steps we are prepared to launch a Træfɪk container which proxies the
incoming traffic.

Fetch, configure and launch Minio

Now it's time to prepare multiple instances of Minio to demonstrate a
multi-tenant solution. That way you are able to launch multiple Minio instances
with different credentials that get routed automatically by Træfɪk.

We will launch the Minio instances with volume mounts from the host system. If
you prefer data containers please take a look at the Minio Docker quickstart guide.

Now you can reach all the launched Minio instances via https://minio-{1,2,3,4,5}.example.com

As a final note I would like to mention that you should start the Docker
containers with the init system of your operating system. As an example you can
see an example for a systemd service file how I'm launching new Minio
instances. Just store this file as /etc/systemd/system/minio@.service and
start new instances with systemctl start minio@server1,systemctl start minio@server2, systemctl start minio@server3 and the
instances will be available at server1.example.com and so on.