【发布时间】:2020-05-13 12:07:15
【问题描述】:
我正在尝试在阿里云实例中安装gitea 和traefik,但我无法从traefik 获得任何页面或响应。我该如何调试呢? docker logs traefik 没有错误
这是我的docker-compose.yml
version: "3"
networks:
gitea_net:
external: true
internal:
external: false
services:
db:
image: postgres:9.6
restart: always
environment:
- POSTGRES_USER=gitea
- POSTGRES_PASSWORD=gitea
- POSTGRES_DB=gitea
labels:
- "traefik.enable=false"
networks:
- internal
volumes:
- ./postgres:/var/lib/postgresql/data
traefik:
image: traefik:latest
command: --docker
ports:
- 80:80
- 443:443
labels:
- "traefik.enable=true"
- "traefik.backend=dashboard"
- "traefik.frontend.rule=Host:traefik.mydomain.com"
- "traefik.port=8080"
networks:
- gitea_net
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./traefik.toml:/traefik.toml
- ./acme.json:/acme.json
container_name: traefik
restart: always
server:
image: gitea/gitea:latest
environment:
- USER_UID=1000
- USER_GID=1000
restart: always
networks:
- internal
volumes:
- ./gitea:/data
ports:
- "3000"
- "22"
labels:
- "traefik.enabled=true"
- "traefik.backend=gitea"
- "traefik.frontend.rule=Host:gitea.mydomain.com"
- "traefik.docker.network=gitea_net"
- "traefik.port=3000"
networks:
- internal
- gitea_net
depends_on:
- db
- traefik
这是我的traefik.toml
#Traefik Global Configuration
debug = true
checkNewVersion = true
logLevel = "ERROR"
#Define the EntryPoint for HTTP and HTTPS
defaultEntryPoints = ["https","http"]
#Define the HTTP port 80 and
#HTTPS port 443 EntryPoint
#Enable automatically redirect HTTP to HTTPS
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
#Enable Traefik Dashboard on port 8080
#with basic authentication method
[entryPoints.dash]
address=":8080"
[entryPoints.dash.auth]
[entryPoints.dash.auth.basic]
users = [
"admin:$apr1$nw$PAVvqQK30eAdrY0l9KCnK1",
]
[api]
entrypoint="dash"
dashboard = true
#Enable retry sending a request if the network error
[retry]
#Define Docker Backend Configuration
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "mydomain.com"
watch = true
exposedbydefault = false
#Letsencrypt Registration
#Define the Letsencrypt ACME HTTP challenge
[acme]
email = "mark@gmail.com"
storage = "acme.json"
entryPoint = "https"
OnHostRule = true
[acme.httpChallenge]
entryPoint = "http"
【问题讨论】: