gitlab in docker behind traefik proxy fails (usually)

前端 未结 2 931
死守一世寂寞
死守一世寂寞 2021-01-12 05:51

I have several web sites running in docker with LetsEncrypt credentials and routed via traefik. I would like to run a local gitlab-ce in docker similarly with LetsEncrypt an

2条回答
  •  佛祖请我去吃肉
    2021-01-12 06:13

    This answer probably comes way too late for you, but I ran into the same issue and was able to solve it.

    The important clue is that the log errors are by the sshd daemon!

    Traefik will, by default, pick the first port exposed by the container (by the Dockerfile, not the ports you manually expose!). In case of the Gitlab container, this is the ssh port 22.

    So Traefik will direct the web requests to Gitlab's SSH daemon.

    To fix this, you need to set the port for Traefik explicitly, with a label:

    Traefik 1.x:

    labels:
        ...
        - traefik.port=80
    

    Traefik 2.x:

    labels:
        - traefik.http.services..loadbalancer.server.port=80
    

提交回复
热议问题