bunkerized-nginx/examples/mattermost/autoconf.yml

93 lines
3.1 KiB
YAML

version: "3"
services:
mattermost:
depends_on:
- postgres
image: mattermost/${MATTERMOST_IMAGE}:${MATTERMOST_IMAGE_TAG}
restart: ${RESTART_POLICY}
security_opt:
- no-new-privileges:true
pids_limit: 200
read_only: ${MATTERMOST_CONTAINER_READONLY}
tmpfs:
- /tmp
networks:
bw-services:
aliases:
- mattermost
volumes:
- ${MATTERMOST_CONFIG_PATH}:/mattermost/config:rw
- ${MATTERMOST_DATA_PATH}:/mattermost/data:rw
- ${MATTERMOST_LOGS_PATH}:/mattermost/logs:rw
- ${MATTERMOST_PLUGINS_PATH}:/mattermost/plugins:rw
- ${MATTERMOST_CLIENT_PLUGINS_PATH}:/mattermost/client/plugins:rw
- ${MATTERMOST_BLEVE_INDEXES_PATH}:/mattermost/bleve-indexes:rw
# When you want to use SSO with GitLab, you have to add the cert pki chain of GitLab inside Alpine
# to avoid Token request failed: certificate signed by unknown authority
# (link: https://github.com/mattermost/mattermost-server/issues/13059 and https://github.com/mattermost/docker/issues/34)
# - ${GITLAB_PKI_CHAIN_PATH}:/etc/ssl/certs/pki_chain.pem:ro
environment:
# timezone inside container
- TZ
# necessary Mattermost options/variables (see env.example)
- MM_SQLSETTINGS_DRIVERNAME
- MM_SQLSETTINGS_DATASOURCE
# necessary for bleve
- MM_BLEVESETTINGS_INDEXDIR
# additional settings
- MM_SERVICESETTINGS_SITEURL
labels:
- bunkerweb.SERVER_NAME=www.example.com
- bunkerweb.MAX_CLIENT_SIZE=50m
# Methods used to query the api
# more info at https://api.mattermost.com/
- bunkerweb.ALLOWED_METHODS=GET|POST|HEAD|DELETE|PUT
# Reverse proxy to Mattermost
# second endpoint needs websocket enabled
# more info at https://docs.mattermost.com/install/config-proxy-nginx.html
- bunkerweb.USE_REVERSE_PROXY=yes
- bunkerweb.REVERSE_PROXY_INTERCEPT_ERRORS=no
- bunkerweb.REVERSE_PROXY_URL_1=/
- bunkerweb.REVERSE_PROXY_HOST_1=http://mattermost:8065
- bunkerweb.REVERSE_PROXY_URL_2=~ /api/v[0-9]+/(users/)?websocket$$
- bunkerweb.REVERSE_PROXY_HOST_2=http://mattermost:8065
- bunkerweb.REVERSE_PROXY_WS_2=yes
# Default limit rate for URLs
- bunkerweb.LIMIT_REQ_URL_1=/
- bunkerweb.LIMIT_REQ_RATE_1=3r/s
# Limit rate for api endpoints
- bunkerweb.LIMIT_REQ_URL_2=^/api/
- bunkerweb.LIMIT_REQ_RATE_2=10r/s
# Limit rate for static resources
- bunkerweb.LIMIT_REQ_URL_3=^/static/
- bunkerweb.LIMIT_REQ_RATE_3=10r/s
postgres:
image: postgres:${POSTGRES_IMAGE_TAG}
networks:
bw-services:
aliases:
- postgres
restart: ${RESTART_POLICY}
security_opt:
- no-new-privileges:true
pids_limit: 100
read_only: true
tmpfs:
- /tmp
- /var/run/postgresql
volumes:
- ${POSTGRES_DATA_PATH}:/var/lib/postgresql/data
environment:
# timezone inside container
- TZ
# necessary Postgres options/variables
- POSTGRES_USER
- POSTGRES_PASSWORD
- POSTGRES_DB
networks:
bw-services:
external: true
name: bw-services