# Copyright Broadcom, Inc. All Rights Reserved.
# SPDX-License-Identifier: APACHE-2.0

services:
  mariadb:
    image: docker.io/bitnami/mariadb:latest
    environment:
      # ALLOW_EMPTY_PASSWORD is recommended only for development.
      - ALLOW_EMPTY_PASSWORD=yes
      - MARIADB_USER=bn_matomo
      - MARIADB_DATABASE=bitnami_matomo
      # Flag necessary for the database max allowed packet check
      # https://matomo.org/faq/troubleshooting/faq_183/
      - MARIADB_EXTRA_FLAGS=--max_allowed_packet=64MB
    volumes:
      - "mariadb_data:/bitnami/mariadb"
  matomo:
    image: docker.io/bitnami/matomo:5
    ports:
      - "80:8080"
      - "443:8443"
    environment:
      - MATOMO_DATABASE_HOST=mariadb
      - MATOMO_DATABASE_PORT_NUMBER=3306
      - MATOMO_DATABASE_USER=bn_matomo
      - MATOMO_DATABASE_NAME=bitnami_matomo
      # ALLOW_EMPTY_PASSWORD is recommended only for development.
      - ALLOW_EMPTY_PASSWORD=yes
    volumes:
      - "matomo_data:/bitnami/matomo"
    depends_on:
      - mariadb
volumes:
  mariadb_data:
    driver: local
  matomo_data:
    driver: local
