From ec9febc86803d2834128010cbb3aeb86ef4fc21f Mon Sep 17 00:00:00 2001 From: Marco Kundt Date: Thu, 15 Apr 2021 14:42:55 +0200 Subject: [PATCH] possibility for using the containers with an external reverse proxy --- docker-compose.nginx.yml | 18 ++++++++++++++++++ docker-compose.without-nginx.yml | 6 ++++++ docker-compose.yml | 16 ---------------- env.example | 5 +++++ 4 files changed, 29 insertions(+), 16 deletions(-) create mode 100644 docker-compose.nginx.yml create mode 100644 docker-compose.without-nginx.yml diff --git a/docker-compose.nginx.yml b/docker-compose.nginx.yml new file mode 100644 index 0000000..1570166 --- /dev/null +++ b/docker-compose.nginx.yml @@ -0,0 +1,18 @@ +version: "3" + +services: + nginx: + container_name: nginx_mattermost + image: nginx:${NGINX_IMAGE_TAG} + restart: ${RESTART_POLICY} + volumes: + - ${NGINX_MATTERMOST_CONFIG}:/etc/nginx/conf.d/mattermost.conf:ro + - ${NGINX_DHPARAMS_FILE}:/dhparams4096.pem + - ${CERT_PATH}:/cert.pem:ro + - ${KEY_PATH}:/key.pem:ro + environment: + # timezone inside container + - TZ + ports: + - ${HTTPS_PORT}:443 + - ${HTTP_PORT}:80 diff --git a/docker-compose.without-nginx.yml b/docker-compose.without-nginx.yml new file mode 100644 index 0000000..0fa410f --- /dev/null +++ b/docker-compose.without-nginx.yml @@ -0,0 +1,6 @@ +version: "3" + +services: + mattermost: + ports: + - ${APP_PORT}:8065 diff --git a/docker-compose.yml b/docker-compose.yml index bc65742..0ae6ab1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,22 +18,6 @@ services: - POSTGRES_PASSWORD - POSTGRES_DB - nginx: - container_name: nginx_mattermost - image: nginx:${NGINX_IMAGE_TAG} - restart: ${RESTART_POLICY} - volumes: - - ${NGINX_MATTERMOST_CONFIG}:/etc/nginx/conf.d/mattermost.conf:ro - - ${NGINX_DHPARAMS_FILE}:/dhparams4096.pem - - ${CERT_PATH}:/cert.pem:ro - - ${KEY_PATH}:/key.pem:ro - environment: - # timezone inside container - - TZ - ports: - - ${HTTPS_PORT}:443 - - ${HTTP_PORT}:80 - mattermost: depends_on: - postgres diff --git a/env.example b/env.example index 58dc6f9..34ced49 100644 --- a/env.example +++ b/env.example @@ -50,6 +50,11 @@ MATTERMOST_CLIENT_PLUGINS_PATH=./data/mattermost/client-plugins MATTERMOST_IMAGE=mattermost-enterprise-edition MATTERMOST_IMAGE_TAG=latest +## 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 +## or for using it behind another existing reverse proxy. +APP_PORT=8065 + ## Configuration settings for Mattermost. Documentation on the variables and the settings itself can be found at ## https://docs.mattermost.com/administration/config-settings.html ## Keep in mind that variables set here will take precedence over the same setting in config.json. This includes