diff --git a/app/Dockerfile b/app/Dockerfile index bcdf181..e4dc1ab 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -14,12 +14,10 @@ exec bin/platform\n'\ RUN wget https://github.com/mattermost/platform/releases/download/v1.2.1/mattermost.tar.gz \ && tar -xvzf mattermost.tar.gz && rm mattermost.tar.gz -ADD config/config.json /mattermost/config/ -ADD docker-entry.sh / +COPY config.template.json / +COPY docker-entry.sh / RUN chmod +x /docker-entry.sh ENTRYPOINT /docker-entry.sh -VOLUME ["/mattermost/config"] - EXPOSE 80 diff --git a/app/config/config.json b/app/config.template.json similarity index 100% rename from app/config/config.json rename to app/config.template.json diff --git a/app/docker-entry.sh b/app/docker-entry.sh index 0fb3bd3..4904f16 100644 --- a/app/docker-entry.sh +++ b/app/docker-entry.sh @@ -1,6 +1,10 @@ #!/bin/bash echo Starting Platform -sed -Ei "s/PG_ADDR/$PG_PORT_5432_TCP_ADDR/" /mattermost/config/config.json -sed -Ei "s/PG_PORT/$PG_PORT_5432_TCP_PORT/" /mattermost/config/config.json +config=/mattermost/config/config.json +if [ ! -f $config ]; then + cp /config.template.json $config + sed -Ei "s/PG_ADDR/$PG_PORT_5432_TCP_ADDR/" $config + sed -Ei "s/PG_PORT/$PG_PORT_5432_TCP_PORT/" $config +fi cd /mattermost/bin ./platform diff --git a/docker-compose.yml b/docker-compose.yml index 3c1c8c6..c69839b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,6 +4,8 @@ app: build: app links: - db:pg + volumes: + - ./volumes/app/mattermost/config:/mattermost/config:rw web: build: web ports: