【发布时间】:2022-11-17 08:23:12
【问题描述】:
我正在尝试建立我的第一个家庭实验室。 我已经有一些服务作为 docker-container 运行,并且让 Traefik 与它们一起工作。 我现在想对我的 PiHole 实例执行相同的操作。我已经让它工作了,所以我可以通过导航到“pihole.local.myurl.com/admin”来访问仪表板。但是,我想自动添加“/admin”前缀。
我用这个 docker-compose.yml 试过了,但是不会添加前缀:
version: "3"
# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
pihole:
image: pihole/pihole:latest
container_name: pihole
restart: unless-stopped
# For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
networks:
- proxy
ports:
- "53:53/tcp"
- "53:53/udp"
#- "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
#- "8000:80/tcp"
environment:
TZ: 'Europe/Berlin'
WEBPASSWORD: 'my_password'
# Volumes store your data between container upgrades
volumes:
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
- './resolv.conf:/etc/resolv.conf'
labels:
- "traefik.enable=true"
- "traefik.http.routers.pihole.entrypoints=http"
- "traefik.http.routers.pihole.rule=Host(`pihole.local.myurl.com`)"
- "traefik.http.middlewares.pihole-prefix.addPrefix.prefix=/admin"
- "traefik.http.routers.pihole.middlewares=pihole-prefix"
- "traefik.http.middlewares.pihole-https-redirect.redirectscheme.scheme=https"
- "traefik.http.routers.pihole.middlewares=pihole-https-redirect"
- "traefik.http.routers.pihole-secure.entrypoints=https"
- "traefik.http.routers.pihole-secure.rule=Host(`pihole.local.myurl.com`)"
- "traefik.http.routers.pihole-secure.tls=true"
- "traefik.http.routers.pihole-secure.service=pihole"
- "traefik.http.services.pihole.loadbalancer.server.port=80"
- "traefik.docker.network=proxy"
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
#cap_add:
# - NET_ADMIN # Recommended but not required (DHCP needs NET_ADMIN)
networks:
proxy:
external: true
我的 docker-compose 有错误吗?
【问题讨论】:
标签: docker docker-compose traefik pihole