-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatter-stack.yml
103 lines (100 loc) · 3.41 KB
/
matter-stack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# This file allows you to run mattermost within your docker swarm mode cluster
# for more informations check: https://docs.docker.com/engine/swarm/
#
# Simply run:
#
# docker stack up [STACK NAME] -c docker-stack-traefik.yml
#
# In this case mm is going to be stack name, so the command will be:
#
# docker stack up mm -c docker-stack-traefik.yml
#
# From now on all the services that belong to this stack will be prefixed with mm_
# this file defines 3 services, these are going to be mm_db, mm_app and mm_web,
# each of these names is the service's hostname as well, they can communicate
# with each other easily by using the hostname instead of the ip or exposing ports to the host.
#
# As a side note, images tagged as latest are pulled by default,
# that means there's no need to use image:latest
#
# 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'
networks:
traefik-public:
external: true
# network for App <-> DB transactions
mm-in:
driver: overlay
internal: true
# this network faces the outside world
mm-out:
driver: overlay
internal: false
volumes:
mm-config:
mm-data:
mm-logs:
mm-plugins:
mm-dbdata:
services:
db:
# use official mattermost prod-db image
image: mattermost/mattermost-prod-db
networks:
- mm-in
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:5.13.0
networks:
- traefik-public
- mm-in
- mm-out
volumes:
- mm-config:/mattermost/config
- mm-data:/mattermost/data
- mm-logs:/mattermost/logs
- mm-plugins:/mattermost/plugins
- /etc/localtime:/etc/localtime:ro
environment:
# use service's hostname
- DB_HOST=db
# talk to the port within the overlay network
# without (over)exposing ports
- DB_PORT_NUMBER=5432
- MM_USERNAME=mmuser
- MM_PASSWORD=mmuser_password
- MM_DBNAME=mattermost
- MM_SERVICESETTINGS_SITEURL=https://chat.matera3019.it
# pass the edition to be used, default is enterprise
# setting this env var will make the app use the team edition
- edition=team
# in case your config is not in default location
# - MM_CONFIG=/mattermost/config/config.json
deploy:
labels:
- "traefik.enable=true"
- "traefik.http.routers.mattermost.rule=Host(`chat.matera3019.it`)"
- "traefik.http.routers.mattermost.entrypoints=websecure"
- "traefik.http.routers.mattermost.tls.certresolver=letsencryptresolver"
- "traefik.http.services.mattermost.loadbalancer.server.port=8000"
restart_policy:
condition: on-failure