From 36c7c04f54dd2c0c037737b8abab43749137880a Mon Sep 17 00:00:00 2001 From: Marco Kundt Date: Tue, 4 May 2021 14:15:37 +0200 Subject: [PATCH] some minot updates and fixes --- README.md | 16 +++++++++++----- env.example | 2 +- scripts/issue-certificate.sh | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5057c08..805d93c 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,13 @@ $ git pull https://github.com/mattermost/docker $ cd docker ``` -### 2. Create a *.env* file by copying and adjusting the example file +### 2. Create a *.env* file by copying and adjusting the env.example file +Docker will search for an *.env* file when no option specifies another environment file. Afterwards edit it with your preferred text editor. ``` $ 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) +### 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} @@ -46,16 +46,22 @@ $ cp PATH-TO-KEY.PEM ./volumes/web/cert/key-no-password.pem 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*. ``` +$ sudo docker volume create shared-webroot $ bash scripts/issue-certificate.sh -d mm.example.com -o ./certs ``` ### 5. Run `docker-compose` +First ensure the docker daemon is enabled and running: +``` +$ sudo systemctl enable --now docker +``` + #### 5.1 Default (with nginx) ``` -$ sudo docker-compose -f docker-compose.yml -f docker-compose.nginx.yml up -d +$ sudo /usr/local/bin/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 +$ sudo /usr/local/bin/docker-compose -f docker-compose.yml -f docker-compose.without-nginx.yml up -d ``` diff --git a/env.example b/env.example index 70e17ef..b82eca8 100644 --- a/env.example +++ b/env.example @@ -54,7 +54,7 @@ MATTERMOST_PLUGINS_PATH=./volumes/app/mattermost/plugins MATTERMOST_CLIENT_PLUGINS_PATH=./volumes/app/mattermost/client-plugins MATTERMOST_IMAGE=mattermost-enterprise-edition -MATTERMOST_IMAGE_TAG=release-5.34 +MATTERMOST_IMAGE_TAG=5.34 ## The app port is only relevant for using Mattermost without the nginx container as reverse proxy. This is not meant ## to be used with the internal HTTP server exposed but rather in case one wants to host several services on one host diff --git a/scripts/issue-certificate.sh b/scripts/issue-certificate.sh index e45ee9f..8b35621 100755 --- a/scripts/issue-certificate.sh +++ b/scripts/issue-certificate.sh @@ -27,7 +27,7 @@ webroot_path = /usr/share/nginx/html, EOF } -# become root by asking for sudo password +# become root (keeping environment) and make script executable if [ $EUID != 0 ]; then chmod +x "$0" sudo -E ./"$0" "$@"