【发布时间】:2018-05-03 12:09:44
【问题描述】:
我尝试使用 Docker 容器使用 Traefik 配置我的服务器。我配置了 Traefik,让它工作,我得到了仪表板页面。问题是我想拥有自己的 GitLab 服务器。我提取了 GitLab docker 映像并创建了一个 docker-compose 文件。
即使 GitLab 容器需要很长时间才能启动,它似乎也可以工作。我可以从 Traefik 仪表板看到 Gitlab 后端。
问题是当我尝试访问 Gitlab 的地址时,我的浏览器(Firefox 和 Chrome)告诉我我的页面并不完全安全。这是确切的错误:
Connection is not secure. Parts of this page are not secure (such as images)
我不知道为什么会出现此错误,我的配置非常基础。
这是我的 Traefik.toml 配置:
defaultEntryPoints = ["http", "https"]
# Web section is for the dashboard interface
[web]
address = ":8080"
[web.auth.basic]
users = ["admin:$apr1$TF1rGQz9$OdtHJ15PT6LGWObE4tXuK0"]
# entryPoints section configures the addresses that Traefik and the proxied containers can listen on
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
# Acme section is for Let's Encrypt configuration
[acme]
email = "email@email.com"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
onDemand = false
[[acme.domains]]
main = "domain.com"
这是我的 docker-compose.yml
version: '3.3'
networks:
proxy:
external: true
internal:
external: false
services:
gitlab:
image: gitlab/gitlab-ce
container_name: gitlab
labels:
- traefik.backend=gitlab
- traefik.frontend.rule=Host:git.domain.com
- traefik.docker.network=proxy
- traefik.port=80
networks:
- internal
- proxy
这是我的 Traefik 容器的 docker run 命令:
docker run -d \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $PWD/traefik.toml:/traefik.toml \
-v $PWD/acme.json:/acme.json \
-e TZ="Europe/Paris" \
-p 80:80 \
-p 443:443 \
-l traefik.frontend.rule=Host:monitor.domain.com \
-l traefik.port=8080 \
--network proxy \
--name traefik \
traefik:1.3.6-alpine --docker --logLevel=DEBUG
正如您所见,这是一个非常基本的配置,我不明白为什么我无法获得完全安全的 GitLab 页面。在 acme.json 文件中,我看到了我的主域“domain.com”和我的子域“git.domain.com”。所以它应该是安全的。
我错过了什么? :/
【问题讨论】:
-
Stack Overflow 是一个编程和开发问题的网站。这个问题似乎是题外话。请参阅帮助中心的What topics can I ask about here。也许Server Fault 是询问 Traefik 配置问题的更好地方。
标签: docker https docker-compose gitlab traefik