services:
  mattermost:
    image: "mattermost/mattermost-team-edition:latest"
    container_name: ${CONTAINER_NAME}
    restart: always
    networks:
      - 1panel-network
    ports:
      - ${PANEL_APP_PORT_HTTP}:8065
      - ${PANEL_APP_PORT_CALLS}:8443/udp
      - ${PANEL_APP_PORT_CALLS}:8443/tcp
    security_opt:
      - no-new-privileges:true
    read_only: ${MATTERMOST_CONTAINER_READONLY}
    tmpfs:
      - /tmp
    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
      # 删除以下行前的#号表示启用
      #- ${GITLAB_PKI_CHAIN_PATH}:/etc/ssl/certs/pki_chain.pem:ro
    environment:
      - TZ=${TZ}
      - MM_SQLSETTINGS_DRIVERNAME=${MM_SQLSETTINGS_DRIVERNAME}
      - MM_SQLSETTINGS_DATASOURCE=${MM_SQLSETTINGS_DRIVERNAME}://${PANEL_DB_USER}:${PANEL_DB_USER_PASSWORD}@${PANEL_DB_HOST}:${PANEL_DB_PORT}/${PANEL_DB_NAME}?sslmode=disable&connect_timeout=10
      - MM_BLEVESETTINGS_INDEXDIR=${MM_BLEVESETTINGS_INDEXDIR}
      - MM_SERVICESETTINGS_SITEURL=${MM_SERVICESETTINGS_SITEURL}
    labels:
      createdBy: "Apps"

networks:
  1panel-network:
    external: true
