Matomo

In this example, we'll deploy Matomo with its MariaDB database.

1. Create shared variables

Go to "Environment variables" menu and create 4 variables.

  • MATOMO_MYSQL_PASSWORD (don't forget to check the "hide value" box)
  • MATOMO_MYSQL_USER
  • MATOMO_MYSQL_DATABASE
  • MATOMO_MYSQL_ROOT_PASSWORD (don't forget to check the "hide value" box)

2. Create Matomo + MariaDB

Go to "Services" menu and click on Import service:

services:
  - id: matomodb
    name: matomo-db
    dockerConfiguration:
      image: mariadb
      imageVersion: "10.11"
      command: 
        - --max-allowed-packet=128MB
    countMin: 1
    countMax: 1
    ports:
      - listeningPort: 3306
        healthCheckEnabled: false
    environmentVariables:
      - key: MARIADB_AUTO_UPGRADE
        value: "1"
      - key: MARIADB_DISABLE_UPGRADE_BACKUP
        value: "1"
      - key: MARIADB_ROOT_PASSWORD
        value: "%MATOMO_MYSQL_ROOT_PASSWORD%"
      - key: MARIADB_USER
        value: "%MATOMO_MYSQL_USER%"
      - key: MARIADB_PASSWORD
        value: "%MATOMO_MYSQL_PASSWORD%"
      - key: MARIADB_DATABASE
        value: "%MATOMO_MYSQL_DATABASE%"
    sharedEnvironmentVariables:
      - MATOMO_MYSQL_USER
      - MATOMO_MYSQL_DATABASE
      - MATOMO_MYSQL_PASSWORD
      - MATOMO_MYSQL_ROOT_PASSWORD
    volumes:
      - name: matomodb
        path: /var/lib/mysql
    capacityCpuMhz: 500
    capacityMemoryMB: 500
  - id: matomo
    name: matomo
    dockerConfiguration:
      image: matomo
      imageVersion: latest
    countMin: 1
    countMax: 1
    ports:
      - listeningPort: 80
        healthCheckType: HTTP
        healthCheckPath: /
        healthCheckMethod: GET
        loadBalancerRules:
          - publicPort: 443
        healthCheckEnabled: true
        healthCheckTimeoutSeconds: 30
        healthCheckIntervalSeconds: 60
    links:
      - toServiceId: matomodb
        toServicePort: 3306
        localExposedPort: 3306
        variableHost: DB_HOST
        variablePort: DB_PORT
        variableAddress: DB_ADDR
    sharedEnvironmentVariables:
      - MATOMO_MYSQL_USER
      - MATOMO_MYSQL_DATABASE
      - MATOMO_MYSQL_PASSWORD
    environmentVariables:
      - key: MATOMO_DATABASE_HOST
        value: "%DB_HOST%"
      - key: MATOMO_DATABASE_DBNAME
        value: "%MATOMO_MYSQL_DATABASE%"
      - key: MATOMO_DATABASE_USERNAME
        value: "%MATOMO_MYSQL_USER%"
      - key: MATOMO_DATABASE_PASSWORD
        value: "%MATOMO_MYSQL_PASSWORD%"
    capacityCpuMhz: 500
    capacityMemoryMB: 500