0

I have a docker container running gitlab community edition.

It's working fine except that the container remains unhealthty

The problem comes from the /opt/gitlab/etc/gitlab-healthcheck-rc file. It contains url='http://localhost:80/gitlab/help' and should be url='http://myhostname:80/gitlab/help'

If I change it, it's working. But each time there is a gitlab-ctl reconfigure, it turns back to localhost

Indeed, in the log I can see

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

But where is localhost coming from ? Is there a way to start the container with the right value ?

I treid adding a hostname: myhostname in the docker-compose.yml but it's not working.

tweetysat
  • 2,187
  • 14
  • 38
  • 75

1 Answers1

1

You can change that probably in /opt/gitlab/embedded/cookbooks/gitlab/recipes/gitlab-healthcheck.rb as if nginx is enabled it seems that localhost is hardcoded

if node['gitlab']['nginx']['enable']
  ...
  host = "localhost:#{node['gitlab']['nginx']['listen_port']}"
end
Jakub Bujny
  • 4,400
  • 13
  • 27
  • Great it's working. I modified the gitlab-healthcheck.rb file and mount it with the docker-compose.yml. Thanks Jakub Bujny. – tweetysat Sep 12 '19 at 07:47