首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在dokku中使用docker compose?

如何在dokku中使用docker compose?
EN

Stack Overflow用户
提问于 2020-04-09 17:59:02
回答 1查看 3.5K关注 0票数 5

我正在尝试使用https://github.com/rclement/dokku-matomo在独岛实例中运行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容器返回nginx404。

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

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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-05-08 03:49:34

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

代码语言:javascript
运行
复制
# 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

票数 10
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61118535

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档