Hi,
I'm trying to migrate my gitlab + traefik 1.7 and i got some issues.
So to get rid of config errors from git or anything i started a fresh Gitlab install and ofc Traefik V2.
Here what i got atm :
A gitlab just installed via a Docker-Compose file (with OMNIBUS (official docker install from gitlab)) running on https. I can access to early password settings from gitlab install, it works well.
Here is my docker-compose.yml without traefik [Working]:
version: "3.3"
services:
gitlab:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'gitlab.myhostname'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'httpsgitlab.myhostname'
gitlab_rails['gitlab_shell_ssh_port'] = 2200
ports:
- '80:80'
- '443:443'
- '2200:22'
volumes:
- '/srv/gitlab/config:/etc/gitlab'
- '/srv/gitlab/logs:/var/log/gitlab'
- '/srv/gitlab/data:/var/opt/gitlab'
Now come the struggle, so i modified my config as follow so it fit to traefik :
gitlab docker-compose with traefik [not working :/]
version: "3.3"
services:
gitlab:
labels:
- "traefik.enable=true"
- "traefik.http.routers.gitlab.rule=Host(`gitlab.myhostname`)"
- "traefik.http.routers.gitlab.entrypoints=web,web-secure"
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'gitlab.myhostname'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'httpsgitlab.myhostname'
gitlab_rails['gitlab_shell_ssh_port'] = 2200
ports:
- '2200:22'
volumes:
- '/srv/gitlab/config:/etc/gitlab'
- '/srv/gitlab/logs:/var/log/gitlab'
- '/srv/gitlab/data:/var/opt/gitlab'
and ofc here is my traefik docker-compose.yml [not working with gitlab]:
version: '3.3'
services:
reverse-proxy:
image: traefik:latest
command:
- "--entrypoints.web.address=:80"
- "--entrypoints.web-secure.address=:443"
- "--entrypoints.api.address=:8080"
- "--api=true"
- "--api.dashboard=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
ports:
- 80:80
- 443:443
- 8080:8080
labels:
- "traefik.enable=true"
- "traefik.http.routers.api.rule=Host(`traefik.myhostname`)"
- "traefik.http.routers.api.service=api@internal"
- "traefik.http.routers.api.entrypoints=api"
- "traefik.http.routers.api.middlewares=auth"
- "traefik.http.middlewares.auth.basicauth.users=User:salted.password"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
I'm not using any other config file like toml/yaml for traefik, i wanted to make it simple as possible to minimize possible errors. I did tryed my config before with a basic Httpd docker image (http and https config) and it work but since i try with gitlab i get a 404 page not found. (BTW my traefik dashboard/api is reachable and everything works well)
If someone is using this kind of gitlab config or has any clue i will really appreciate it.
NB : I removed any links so weird external link config and domains config are normal