diff --git a/README.md b/README.md index 35de761..8400e4a 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,12 @@ The following instructions deploy Mattermost in a production configuration using If you want to install Enterprise Edition, you can skip this section. -To install the Team Edition, comment out the following line in docker-compose.yaml file: -``` -dockerfile: Dockerfile-enterprise +To install the team edition, comment out the two following lines in docker-compose.yaml file: +```yaml +args: + - edition=team ``` +The `app` Dockerfile will read the `edition` build argument to install Team (`edition = 'team'`) or Entreprise (`edition != team`) edition. ### Database container This repository offer a Docker image for the Mattermost database. It is a customized PostgreSQL image that you should configure with following environment variables : diff --git a/app/Dockerfile b/app/Dockerfile index d0cd167..48430d9 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -4,6 +4,9 @@ FROM ubuntu:14.04 ENV PATH="/mattermost/bin:${PATH}" ENV MM_VERSION=4.2.0 +# Build argument to set Mattermost edition +ARG edition=entreprise + # Install some needed packages RUN apt-get update \ && apt-get -y install \ @@ -12,9 +15,10 @@ RUN apt-get update \ netcat \ && rm -rf /var/lib/apt/lists/* -# Prepare Mattermost +# Get Mattermost RUN mkdir -p /mattermost/data \ - && curl https://releases.mattermost.com/$MM_VERSION/mattermost-team-$MM_VERSION-linux-amd64.tar.gz | tar -xvz \ + && if [ "$edition" = "team" ] ; then curl https://releases.mattermost.com/$MM_VERSION/mattermost-team-$MM_VERSION-linux-amd64.tar.gz | tar -xvz ; \ + else curl https://releases.mattermost.com/$MM_VERSION/mattermost-$MM_VERSION-linux-amd64.tar.gz | tar -xvz ; fi \ && cp /mattermost/config/config.json /config.json.save \ && rm -rf /mattermost/config/config.json diff --git a/docker-compose.yml b/docker-compose.yml index 25c8709..2ea8825 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,8 +21,9 @@ services: app: build: context: app - # comment out for team edition - dockerfile: Dockerfile-enterprise + # comment out 2 following lines for team edition + # args: + # - edition=team restart: unless-stopped volumes: - ./volumes/app/mattermost/config:/mattermost/config:rw