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.
mattermost/README.md

121 lines
3.4 KiB
Markdown
Raw Normal View History

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]
## Installation
2015-11-30 07:09:07 +01:00
### Install with SSL certificate
2015-11-30 07:09:07 +01: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
```
environment:
- MATTERMOST_ENABLE_SSL=true
2016-06-02 17:13:13 +02:00
```
2015-11-30 07:09:07 +01: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
them you may generate a self-signed SSL certificate.
2015-11-30 07:09:07 +01:00
3. Build and run mattermost
docker-compose up -d
4. Open `https://your.domain` with your web browser.
### Install without SSL certificate
1. Open docker-compose.yml and set `MATTERMOST_ENABLE_SSL` to false.
2016-06-02 17:13:13 +02:00
```
environment:
- MATTERMOST_ENABLE_SSL=false
2016-06-02 17:13:13 +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
docker-compose stop
## Removing
2015-11-30 07:09:07 +01:00
### Remove the containers
2015-11-30 07:09:07 +01:00
docker-compose stop && docker-compose rm
2015-11-30 07:09:07 +01:00
### Remove the data and settings of your mattermost instance
sudo rm -rf volumes
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.
## 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
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).
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/
[prod-ubuntu.rst]: https://github.com/mattermost/docs/blob/master/source/install/prod-ubuntu.rst