docker 上的 Gitlab 社区 运行 - Healthcheck

Gitlab Community running on docker - Heathcheck

我有一个docker container运行gitlab community edition.

它工作正常,除了容器仍然存在 unhealthty

问题来自 /opt/gitlab/etc/gitlab-healthcheck-rc 文件。它包含 url='http://localhost:80/gitlab/help' 并且应该是 url='http://myhostname:80/gitlab/help'

如果我更改它,它就会起作用。但是每出现一个gitlab-ctl reconfigure,就变回localhost

确实,在日志中我可以看到

  * template[/opt/gitlab/etc/gitlab-healthcheck-rc] action create
    - update content in file /opt/gitlab/etc/gitlab-healthcheck-rc from 1e4e16 to 1a5b11

但是 localhost 是从哪里来的呢?有没有办法以正确的值启动容器?

我想在 docker-compose.yml 中添加一个 hostname: myhostname,但它不起作用。

您可以在 /opt/gitlab/embedded/cookbooks/gitlab/recipes/gitlab-healthcheck.rb 中更改它,就像启用了 nginx 一样,本地主机似乎是硬编码的

if node['gitlab']['nginx']['enable']
  ...
  host = "localhost:#{node['gitlab']['nginx']['listen_port']}"
end