docker-stack.yml 2.59 KB
Newer Older
PICHOU Kyâne's avatar
PICHOU Kyâne committed
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
# 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: