如何使用 docker compose 和 dokku?

waf*_*ffl 5 docker dokku docker-compose

我正在尝试使用https://github.com/rclement/dokku-matomo在 dokku 实例中运行 matomo

这个 dokku 设置使用了一个 docker 镜像:https : //github.com/crazy-max/docker-matomo

上面的 dokku 设置使用了相当旧版本的 docker-matomo 镜像(3.5.1)。我尝试将 Dockerfile 更新为 pull crazymax/matomo:latest(3.13.4-RC1),这似乎有效,但现在我的 Dokku 容器返回了 nginx 404。

根据我对此问题的理解:https : //github.com/crazy-max/docker-matomo/issues/14需要更新traefik.frontend.rule=Host:matomo.example.com变量的配置docker-compose.yml以指向我的 Dokku 主机名。

我试过编辑docker-compose.yml文件并将其放置在我的 Dokku 存储库的根目录中,但似乎没有任何效果。我的困惑在于如何docker-compose与 Dokku一起使用?

Mic*_*cht 10

您不需要使用docker-compose.yml来部署到 Dokku。下面是关于如何docker-matomo通过直接从 Docker Hub 拉取镜像来设置Dokku的运行。通过使用这种不同的部署方法,您应该能够重新使用旧数据库。

# 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 DOKKU_LETSENCRYPT_EMAIL=letsencrypt@example.com
dokku letsencrypt matomo
dokku letsencrypt:auto-renew matomo

# Grep MariaDB information for the setup
dokku mariadb:info mariadb-matomo
Run Code Online (Sandbox Code Playgroud)

我还创建了一个拉取请求来更新rclement/dokku-matomohttps : //github.com/rclement/dokku-matomo/pull/2