如何在dokku中使用docker compose?

问题描述 投票:2回答:1

我想在dokku实例中使用以下方法运行matomo https:/github.comrclementdokku-matomo。

这个dokku设置使用的是docker镜像。https:/github.comcrazy-maxdocker-matomo。

上面的dokku设置使用了相当老版本的docker-matomo镜像(3.5.1)。我尝试更新Docker文件,将其拉到了 crazymax/matomo:latest (3.13.4-RC1),这似乎是可行的,但现在我的Dokku容器返回一个nginx 404。

根据我对这个问题的理解。https:/github.comcrazy-maxdocker-matomoissues14。 的配置需要更新。traefik.frontend.rule=Host:matomo.example.com 中的变量 docker-compose.yml 指向我的Dokku主机名。

我试过编辑并将 docker-compose.yml 文件在我的独库仓库根目录下,但似乎没有任何效果。我的困惑在于如何使用 docker-compose 与Dokku?

docker docker-compose dokku
1个回答
3
投票

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

# 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

我还创建了一个拉请求来更新 rclementdokku-matomo: https:/github.comrclementdokku-matomopull2。

© www.soinside.com 2019 - 2024. All rights reserved.