Unable to configure Gitlab CE when installing with Docker Compose

Hello all,

I have a docker-compose.yml that is meant to spin up an instance of Gitlab, a gitlab runner, jenkins and Nexus. When I run docker compose up -d all four start up successfully. However, just a few seconds after that the Gitlab instance will fail and attempt to restart.

When I look at the logs it tells me to configure gitlab for my system by editing /etc/gitlab/gitlab.rb, but whenever I attempt to use docker exec -it [gitlab] vim /etc/gitlab/gitlab.rb vim immediately quits on me, since the container is constantly stopping and restarting. I was able to run the update-permissions command, but that doesn’t seem to have changed anything.

Looking at the logs I pretty much just see Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb, followed by this:

Any help would be greatly appreciated.

I too use a docker-compose.yml file to configure, launch the gitlab/gitlab-ce:15.6.3-ce.0 image. All of my configuration is handled through the service’s GITLAB_OMNIBUS_CONFIG key as such:

   environment:
     GITLAB_OMNIBUS_CONFIG: |
       external_url 'https://gitlab.xxxx.xxxxx' #<-- your public FQDN for your setup.
       letsencrypt['enabled'] = false
       nginx['listen_port'] = 443
       nginx['redirect_http_to_https'] = true
       nginx['ssl_certificate'] = "/etc/gitlab/ssl/xxxxxxx.crt"
       nginx['ssl_certificate_key'] = "/etc/gitlab/ssl/xxxxxxxx.key"
       nginx['ssl_protocols'] = "TLSv1.1 TLSv1.2"
       registry_external_url 'https://gitlab.xxxxxxxx:4567'
       gitlab_rails['registry_enabled'] = true
       registry_nginx['listen_port'] = 4567
       registry_nginx['listen_https'] = true
       ...
   ports:
     - '80:80'
     - '443:443'
     - '22:22'
     - '4567:4567'
   volumes:
     - '/srv/gitlab/config:/etc/gitlab'
     - '/srv/gitlab/logs:/var/log/gitlab'
     - '/srv/gitlab/data:/var/opt/gitlab'

So place your x509 PEM key in the host’s /srv/gitlab/config/ssl directory, same for the private key used to sign the CSR that resulted in the x509 certificate. Depending on the Root CA accessible to your container, that PEM cert might need to be the complete chain.
Other config properties may also need to be set for your setup.
once you get the container to start ok, you might need to use the gitlab-ctl reconfigure command.

IHTH.