Manual fork of official GitHub repository for docker deployment of Mattermost https://github.com/mattermost/mattermost-docker
This repository has been archived on 2021-08-31. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
Pan Luo 97966787dd
Use $PGDATA env var to setup wal-e
$PGDATA is set in upstream postgres dockerfile and should be used in
downstream in case the postgres data directory is changed in the future.
2016-05-08 10:51:16 -07:00
app app: Upgrade to mattermost 2.2.0 2016-04-19 10:57:12 +09:00
db Use $PGDATA env var to setup wal-e 2016-05-08 10:51:16 -07:00
web web: Fix HTTPS redirecting 2016-04-20 22:35:51 +09:00
.travis.yml travis: Display logs after failure 2016-04-20 15:09:16 +09:00
docker-compose-nossl.yml Add Wal-E backup support 2016-04-20 02:13:36 -07:00
docker-compose-ssl.yml Add Wal-E backup support 2016-04-20 02:13:36 -07:00
Dockerrun.aws.json Support aws beanstalk 2016-04-25 00:36:38 +09:00
LICENSE Add README and LICENSE 2015-11-30 17:58:11 +09:00
README.aws.md Support aws beanstalk 2016-04-25 00:36:38 +09:00
README.md README: Embeded travis status image 2016-04-25 00:44:45 +09:00

Dockerfiles for Mattermost in production

See README.aws.md if you want to install it on AWS Elastic Beanstalk.

Build Status

Requirements

Installation

Install with SSL certificate

  1. Create a symbolic link docker-compose.yml to docker-compose-ssl.yml:

    ln -s docker-compose-ssl.yml docker-compose.yml

  2. Put your SSL certificate as web/cert/cert.pem and the private key that has no password as web/cert/private/key-no-password.pem. If you don't have them you may generate a self-signed SSL certificate.

  3. Build and run mattermost

    docker-compose up -d

  4. Open https://your.domain with your web browser.

Install without SSL certificate

  1. Create a symbolic link docker-compose.yml to docker-compose-nossl.yml:

    ln -s docker-compose-nossl.yml docker-compose.yml

  2. Build and run mattermost

    docker-compose up -d

  3. Open http://your.domain with your web browser.

Starting/Stopping

Start

docker-compose start

Stop

docker-compose stop

Removing

Remove the containers

docker-compose stop && docker-compose rm

Remove the data and settings of your mattermost instance

sudo rm -rf volumes

Database Backup

When AWS S3 environment variables are specified on db docker container, it enables Wel-E backup to S3.

docker run -d --name mattermost-db \
    -e AWS_ACCESS_KEY_ID=XXXX \
    -e AWS_SECRET_ACCESS_KEY=XXXX \
    -e WALE_S3_PREFIX=s3://BUCKET_NAME/PATH \
    -e AWS_REGION=us-east-1
    -v ./volumes/db/var/lib/postgresql/data:/var/lib/postgresql/data
    -v /etc/localtime:/etc/localtime:ro
    db

All four environment variables are required. It will enable completed WAL segments sent to archive storage (S3). The base backup and clean up can be done through the following command:

# base backup
docker exec mattermost-db su - postgres sh -c "/usr/bin/envdir /etc/wal-e.d/env /usr/local/bin/wal-e backup-push /var/lib/postgresql/data"
# keep the most recent 7 base backups and remove the old ones
docker exec mattermost-db su - postgres sh -c "/usr/bin/envdir /etc/wal-e.d/env /usr/local/bin/wal-e delete --confirm retain 7"

Those tasks can be executed through a cron job or systemd timer.

Known Issues

  • Do not modify the Listen Address in Service Settings.
  • Rarely 'app' container fails to start because of "connection refused" to database. Workaround: Restart the container.

More informations

If you want to know how to use docker-compose, see the overview page.

For the server configurations, see prod-ubuntu.rst of mattermost.