Gitlab on Docker not starting properly

Problem to solve

Hey all, a few hours ago i attempted to run gitlab-ce via docker-compose. But the site never became available and the logs were basically repeating themselves. There was only one error that was repeating again and again. I am unsure how to aproach this error… maybe someone can push me in the right direction here…
The site was showing an Error 500 Internal Server Error

The error:

==> /var/log/gitlab/gitlab-workhorse/current <==
redis: 2024/05/01 13:13:26 pubsub.go:168: redis: discarding bad PubSub connection: EOF
{"error":"keywatcher: pubsub receive: EOF","level":"error","msg":"","time":"2024-05-01T13:13:26Z"}

Steps to reproduce

Run Gilab with this docker compose:

    image: gitlab/gitlab-ce:latest
    container_name: gitlab_ce
    restart: always
    hostname: git.<mydomain>
        external_url 'https://git.<mydomain>'
      - 2222:22
      - /opt/volumes/gitlab-config:/etc/gitlab
      - /opt/volumes/gitlab-logs:/var/log/gitlab
      - /opt/volumes/gitlab-data:/var/opt/gitlab
    shm_size: 256m
      - gitlab_root_password
      - traefik.enable=true
      - traefik.http.routers.gitlab_ce.rule=Host(`git.<mydomain>`)
      - traefik.http.routers.gitlab_ce.entrypoints=websecure
      - traefik.http.routers.gitlab_ce.tls.certresolver=myresolver
      - web
    container_name: gitlab_ce_docs
    hostname: https://docs.git.<mydomain>
      - traefik.enable=true
      - traefik.http.routers.gitlab_ce_docs.rule=Host(`docs.git.<mydomain>`)
      - traefik.http.routers.gitlab_ce_docs.entrypoints=websecure
      - traefik.http.routers.gitlab_ce_docs.tls.certresolver=myresolver
      - web

    file: /etc/docker-dockge-setup/secrets/gitlab_root_password.txt
    external: true


Nothing appart from the compose.yml


I am on Debian 12
Docker version 26.0.0, build 2ae903e
Latest gitlab image

And I use Traefik as a reverse proxy. Thats why I dont expose 443 or 80.

The last ~200 log lines: ==> /var/log/gitlab/gitlab-exporter/current <==2024-05-01_13:36:38.38191 ::1 - -

wow such great forum

It doesn’t work because you didn’t open any ports to communicate with Gitlab. You should have done something like:

  - 8443:443
  - 8080:80

and then configure traefik on 80/443 to redirect to 8080/8443 on the container. Since you didn’t open any ports, how do you expect traefik to communicate with the container? All you opened was SSH port. Communication is then:

Traefik (80/443) → Docker (8080/8443) → Inside Container where Gitlab app listens (80/443).

There aren’t probably too many people using traefik, since nobody replied to you. Also remember, free support is just that - people help out if and when they can. You are not guaranteed a response. You should change your expectations a little. If you think you expect a reply to be guaranteed, perhaps you should pay for support? People visit here and give up their own time to help as and when they can. Respect that.

I do not need to expose the ports of the container. The traefik receives all 80 and 443 traffic and is able to send it directly to the correct container. But thats also true with the Nginx Proxy Manager.
Exposing random ports for every container is a massive risk btw and totally pointless.
I only expose 22, 80, 443, 2222 (gitlab ssh) and 5002 (My dockge instance). Everything else is routed through the reverse proxy.

I tested around a little and found that my VM was too weak. I am now running the gitlab instance on my prod system with 64GB RAM and 6 Real Cores. Only Mail is not working right now. But I will test around more on that till I do a post here.