Add docker swarm mode support (#176)
* add docker swarm mode support Signed-off-by: Pierre DEMAGNY <pdemagny@printoclock.com> * use official prod-web image, respect project's standard directory layout & update readme accordingly. Signed-off-by: Pierre DEMAGNY <pdemagny@printoclock.com>
This commit is contained in:
parent
0ff2e7ea05
commit
bcbe60a8d8
21
README.md
21
README.md
@ -139,6 +139,27 @@ docker-compose up -d
|
|||||||
```
|
```
|
||||||
See the [offical Upgrade Guide](http://docs.mattermost.com/administration/upgrade.html) for more details.
|
See the [offical Upgrade Guide](http://docs.mattermost.com/administration/upgrade.html) for more details.
|
||||||
|
|
||||||
|
## Installation using Docker Swarm Mode
|
||||||
|
|
||||||
|
The following instructions deploy Mattermost in a production configuration using docker swarm mode on one node.
|
||||||
|
Running containerized applications on multi-node swarms involves specific data portability and replication handling that are not covered here.
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
|
* [docker] (1.12.0+)
|
||||||
|
|
||||||
|
### Swarm Mode Installation
|
||||||
|
|
||||||
|
First, create mattermost directory structure on the docker hosts:
|
||||||
|
```
|
||||||
|
mkdir -p /var/lib/mattermost/{cert,config,data,logs}
|
||||||
|
```
|
||||||
|
|
||||||
|
Then, fire up the stack in your swarm:
|
||||||
|
```
|
||||||
|
docker stack deploy -c contrib/swarm/docker-stack.yml mattermost
|
||||||
|
```
|
||||||
|
|
||||||
## Known Issues
|
## Known Issues
|
||||||
|
|
||||||
* Do not modify the Listen Address in Service Settings.
|
* Do not modify the Listen Address in Service Settings.
|
||||||
|
78
contrib/swarm/docker-stack.yml
Normal file
78
contrib/swarm/docker-stack.yml
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
# This file allow you to run mattermost within your docker swarm mode cluster
|
||||||
|
# for more informations check: https://docs.docker.com/engine/swarm/
|
||||||
|
#
|
||||||
|
# use latest compose v3.3 file format for optimal compatibility with latest docker release and swarm features.
|
||||||
|
# see https://docs.docker.com/compose/compose-file/compose-versioning/#version-3
|
||||||
|
# and https://docs.docker.com/compose/compose-file/compose-versioning/#version-33
|
||||||
|
# and https://docs.docker.com/compose/compose-file/compose-versioning/#upgrading
|
||||||
|
|
||||||
|
version: '3.3'
|
||||||
|
|
||||||
|
services:
|
||||||
|
db:
|
||||||
|
# use official mattermost prod-db image
|
||||||
|
image: mattermost/mattermost-prod-db:latest
|
||||||
|
ports:
|
||||||
|
- "5432"
|
||||||
|
networks:
|
||||||
|
- mm-network
|
||||||
|
volumes:
|
||||||
|
# use a named-volume for data persistency
|
||||||
|
- mm-dbdata:/var/lib/postgresql/data
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: mmuser
|
||||||
|
POSTGRES_PASSWORD: mmuser_password
|
||||||
|
POSTGRES_DB: mattermost
|
||||||
|
# uncomment the following to enable backup
|
||||||
|
# AWS_ACCESS_KEY_ID=XXXX
|
||||||
|
# AWS_SECRET_ACCESS_KEY=XXXX
|
||||||
|
# WALE_S3_PREFIX=s3://BUCKET_NAME/PATH
|
||||||
|
# AWS_REGION=us-east-1
|
||||||
|
deploy:
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
app:
|
||||||
|
# use official mattermost prod-app image
|
||||||
|
image: mattermost/mattermost-prod-app:latest
|
||||||
|
ports:
|
||||||
|
- "8065"
|
||||||
|
networks:
|
||||||
|
- mm-network
|
||||||
|
volumes:
|
||||||
|
- /var/lib/mattermost/config:/mattermost/config:rw
|
||||||
|
- /var/lib/mattermost/data:/mattermost/data:rw
|
||||||
|
- /var/lib/mattermost/logs:/mattermost/logs:rw
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
environment:
|
||||||
|
DB_HOST: db
|
||||||
|
DB_PORT_NUMBER: 5432
|
||||||
|
MM_USERNAME: mmuser
|
||||||
|
MM_PASSWORD: mmuser_password
|
||||||
|
MM_DBNAME: mattermost
|
||||||
|
# in case your config is not in default location
|
||||||
|
# MM_CONFIG=/mattermost/config/config.json
|
||||||
|
deploy:
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
web:
|
||||||
|
# use official mattermost prod-web image
|
||||||
|
image: mattermost/mattermost-prod-web:latest
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
- "443:443"
|
||||||
|
networks:
|
||||||
|
- mm-network
|
||||||
|
volumes:
|
||||||
|
# This directory must have cert files
|
||||||
|
- /var/lib/mattermost/cert:/cert:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
deploy:
|
||||||
|
restart_policy:
|
||||||
|
condition: on-failure
|
||||||
|
|
||||||
|
networks:
|
||||||
|
mm-network:
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
mm-dbdata:
|
0
web/docker-entry.sh
Normal file → Executable file
0
web/docker-entry.sh
Normal file → Executable file
Reference in New Issue
Block a user