From 16d8e165c2aab0f1089888ad53d556b8aeed29e5 Mon Sep 17 00:00:00 2001 From: Marco Kundt Date: Thu, 22 Apr 2021 16:04:06 +0200 Subject: [PATCH] add readme.md --- README.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..5057c08 --- /dev/null +++ b/README.md @@ -0,0 +1,61 @@ +# Mattermost Docker setup + +This repository is meant to replace the previous *mattermost-docker* repository and tries to stay as close as possible +to the old one. Migrating will include some steps and while trying to keep it simple the structure changed. To keep it +simple all the basic configuration can be done through the *.env* file. + +## Prequisites +1. A Docker installation is needed (https://docs.docker.com/engine/install/) +2. Docker-compose needs to be >= 1.28 (https://docs.docker.com/compose/install/) + +## Quick setup +These steps are required for new Mattermost setups and don't include everything needed when already using +*mattermost-docker*. + +### 1. Cloning the repository (as an alternative please download it as archive) +``` +$ git pull https://github.com/mattermost/docker +$ cd docker +``` + +### 2. Create a *.env* file by copying and adjusting the example file +``` +$ cp env.example .env +``` + +### 3. Create the needed directores and set permissions (this orientates on the previous *mattermost-docker* structure and the + direcories can be changed in the *.env* file) + +``` +$ mkdir -p ./volumes/app/mattermost/{config,data,logs,plugins,client-plugins} +$ sudo chown -R 2000:2000 ./volumes/app/mattermost + +## when using the provided nginx and if a certificate and key already exists +$ mkdir -p ./volumes/web/cert +``` + +### 4. Placing the certificate and key (if using provided nginx) +#### 4.1 Pre-existing certificate and key +``` +$ cp PATH-TO-CERT.PEM ./volumes/web/cert/cert.pem +$ cp PATH-TO-KEY.PEM ./volumes/web/cert/key-no-password.pem +``` +#### 4.2 Let's Encrypt +**TODO: add link to Let's Encrypt certificate guide** + +For using Let's Encrypt you can follow this guide LINK or use the this Bash script scripts/issue-certificate.sh. Both +methods requires you to change the path to the Let's Encrypt config folders inside the *.env*. +``` +$ bash scripts/issue-certificate.sh -d mm.example.com -o ./certs +``` + +### 5. Run `docker-compose` +#### 5.1 Default (with nginx) +``` +$ sudo docker-compose -f docker-compose.yml -f docker-compose.nginx.yml up -d +``` + +#### 5.2. Without nginx (for use behind an existing reverse proxy) +``` +$ sudo docker-compose -f docker-compose.yml -f docker-compose.without-nginx.yml up -d +```