簡體   English   中英

如何使用 docker 與 dokku 組合?

[英]How to use docker compose with dokku?

我正在嘗試使用https://github.com/rclement/dokku-matomo在 dokku 實例中運行 matomo

此 dokku 設置使用 docker 映像: https://github.com/crazy-max/docker-matomo

上面的 dokku 設置使用了相當舊版本的 docker-matomo 映像(3.5.1)。 我嘗試更新 Dockerfile 以拉取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 一起使用?

您不需要使用docker-compose.yml來部署到 Dokku。 下面是關於如何通過直接從 Docker Hub 拉取圖像來在 Dokku 上設置 docker docker-matomo的運行過程。 通過使用這種不同的部署方法,您應該能夠重新使用舊數據庫。

# 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

我還創建了一個拉取請求來更新rclement/dokku-matomohttps://github.com/rclement/dokku-matomo/pull/2

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM