2015-11-30 07:09:07 +01:00
Dockerfiles for Mattermost in production
2016-04-12 07:09:03 +02:00
See [README.aws.md ](./README.aws.md ) if you want to install it on AWS Elastic Beanstalk.
2016-04-24 17:44:04 +02:00
[![Build Status ](https://travis-ci.org/mattermost/mattermost-docker.svg?branch=master )](https://travis-ci.org/mattermost/mattermost-docker)
2016-04-24 17:34:28 +02:00
## Requirements
2015-11-30 07:09:07 +01:00
* [docker]
* [docker-compose]
2016-04-07 10:34:10 +02:00
## Installation
2015-11-30 07:09:07 +01:00
2016-04-07 10:34:10 +02:00
### Install with SSL certificate
2015-11-30 07:09:07 +01:00
2016-06-01 18:36:36 +02:00
1. Open docker-compose.yml and set `MATTERMOST_ENABLE_SSL` to true.
2015-11-30 07:09:07 +01:00
2016-06-02 17:13:13 +02:00
```
2016-06-01 18:36:36 +02:00
environment:
- MATTERMOST_ENABLE_SSL=true
2016-06-02 17:13:13 +02:00
```
2015-11-30 07:09:07 +01:00
2016-08-12 03:38:54 +02:00
2. Put your SSL certificate as `./volumes/web/cert/cert.pem` and the private key that has
no password as `./volumes/web/cert/key-no-password.pem` . If you don't have
2016-04-07 10:34:10 +02:00
them you may generate a self-signed SSL certificate.
2015-11-30 07:09:07 +01:00
2016-04-07 10:34:10 +02:00
3. Build and run mattermost
docker-compose up -d
4. Open `https://your.domain` with your web browser.
### Install without SSL certificate
2016-06-01 18:36:36 +02:00
1. Open docker-compose.yml and set `MATTERMOST_ENABLE_SSL` to false.
2016-04-07 10:34:10 +02:00
2016-06-02 17:13:13 +02:00
```
2016-06-01 18:36:36 +02:00
environment:
- MATTERMOST_ENABLE_SSL=false
2016-06-02 17:13:13 +02:00
```
2016-04-07 10:34:10 +02:00
2. Build and run mattermost
docker-compose up -d
3. Open `http://your.domain` with your web browser.
## Starting/Stopping
### Start
docker-compose start
2015-11-30 07:09:07 +01:00
### Stop
2016-04-07 10:34:10 +02:00
docker-compose stop
## Removing
2015-11-30 07:09:07 +01:00
2015-12-04 10:19:06 +01:00
### Remove the containers
2015-11-30 07:09:07 +01:00
2016-04-07 10:34:10 +02:00
docker-compose stop & & docker-compose rm
2015-11-30 07:09:07 +01:00
2015-12-04 10:19:06 +01:00
### Remove the data and settings of your mattermost instance
2016-04-07 10:34:10 +02:00
sudo rm -rf volumes
2015-12-04 10:19:06 +01:00
2016-04-20 05:50:19 +02:00
## Database Backup
2016-06-09 16:31:33 +02:00
When AWS S3 environment variables are specified on db docker container, it enables [Wal-E ](https://github.com/wal-e/wal-e ) backup to S3.
2016-04-20 05:50:19 +02:00
```bash
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:
```bash
# 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.
2016-05-17 14:20:41 +02:00
## Upgrading to Team Edition 3.0.x from 2.x
You need to migrate your database before upgrading mattermost to 3.0.x from
2.x. Run these commands in the latest mattermost-docker directory.
docker-compose rm -f app
docker-compose build app
docker-compose run app -upgrade_db_30
docker-compose up -d
See the [offical Upgrade Guide ](http://docs.mattermost.com/administration/upgrade.html ) for more details.
2015-12-03 16:40:11 +01:00
## Known Issues
* Do not modify the Listen Address in Service Settings.
2015-12-09 09:17:25 +01:00
* Rarely 'app' container fails to start because of "connection refused" to
2015-12-04 10:20:00 +01:00
database. Workaround: Restart the container.
2015-12-03 16:40:11 +01:00
2015-11-30 07:09:07 +01:00
## More informations
If you want to know how to use docker-compose, see [the overview
page](https://docs.docker.com/compose).
2016-09-19 17:30:29 +02:00
If you want to run Mattermost on Kubernetes you can start with the [manifest examples in the kubernetes folder ](contrib/kubernetes/README.md )
2016-09-19 07:21:01 +02:00
2016-04-17 11:37:57 +02:00
For the server configurations, see [prod-ubuntu.rst] of mattermost.
2015-11-30 07:09:07 +01:00
[docker]: http://docs.docker.com/engine/installation/
[docker-compose]: https://docs.docker.com/compose/install/
2016-04-17 11:37:57 +02:00
[prod-ubuntu.rst]: https://github.com/mattermost/docs/blob/master/source/install/prod-ubuntu.rst