How to use docker compose with dokku?
Asked Answered
M

1

6

I'm trying to run matomo in a dokku instance with https://github.com/rclement/dokku-matomo

This dokku setup is using a docker image: https://github.com/crazy-max/docker-matomo

The above dokku setup uses quite an old version of the docker-matomo image (3.5.1). I attempted to update the Dockerfile to pull crazymax/matomo:latest (3.13.4-RC1), which seemed to work but now my Dokku container returns an nginx 404.

From what I understand from this issue: https://github.com/crazy-max/docker-matomo/issues/14 there needs to be an update to the configuration of the traefik.frontend.rule=Host:matomo.example.com variable in docker-compose.yml to point to my Dokku hostname.

I've tried editing and placing the docker-compose.yml file in the root of my Dokku repository, but it seems to have no effect. My confusion lies in how to use docker-compose with Dokku?

Marisolmarissa answered 9/4, 2020 at 9:59 Comment(1)
It's very easy to install Matomo on Dokku. Keep in mind, all Dokku apps are just Docker containers built when pushed. So you can take a Docker image, re-tag it (as ion the docs) and run it. In the case of Matomo, you'll need mysql. Well just install the Dokku MySQL plugin and --link them. With large compose files, perhaps there should be a tool.Pudgy
K
13

You do not need to use docker-compose.yml to deploy to Dokku. Here is a run through on how to set up docker-matomo on Dokku by pulling the image directly from Docker Hub. You should be able to re-use your old database, by using this different deploy method.

# Pull image and tag it
docker pull crazymax/matomo:latest
docker tag crazymax/matomo:latest dokku/matomo:v3.13.5

# Create app
dokku apps:create matomo
dokku config:set --no-restart matomo TZ=Europe/Berlin MEMORY_LIMIT=256M UPLOAD_MAX_SIZE=16M OPCACHE_MEM_SIZE=128 REAL_IP_FROM=0.0.0.0/32 REAL_IP_HEADER=X-Forwarded-For LOG_LEVEL=WARN

# Set domain
dokku domains:set matomo matomo.example.com

# Create database
dokku mariadb:create matomo-mariadb

# Create and mount persistent volume
mkdir /var/lib/dokku/data/storage/matomoo
# UID:GUID are set to 101 in the nginx image that crazymax/matomo uses
chown 101:101 /var/lib/dokku/data/storage/matomo
dokku storage:mount matomo /var/lib/dokku/data/storage/matomo:/data

# Add correct proxy ports
dokku proxy:ports-add matomo http:80:8000
dokku proxy:ports-remove matomo http:80:5000

# Deploy app for the first time
dokku tags:deploy matomo v3.13.5

# Setup Let's Encrypt
dokku config:set --no-restart matomo [email protected]
dokku letsencrypt matomo
dokku letsencrypt:auto-renew matomo

# Grep MariaDB information for the setup
dokku mariadb:info mariadb-matomo

I also created a pull request to update rclement/dokku-matomo: https://github.com/rclement/dokku-matomo/pull/2

Kerge answered 7/5, 2020 at 19:49 Comment(2)
I will have a look at the PR/update as soon as I have a chance, thank you so much for the explanation and the PR!Marisolmarissa
The PR is already merged, so you just need to checkout the master branch in the repository!Kerge

© 2022 - 2024 — McMap. All rights reserved.