# 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: