-
Notifications
You must be signed in to change notification settings - Fork 3
/
pihole.yml
67 lines (65 loc) · 2.14 KB
/
pihole.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
version: "3.7"
services:
dns-over-https:
image: dns-over-https:staging
networks:
pihole:
ports:
- 5053:5053/udp
environment:
- TZ=${TZ}
- TUNNEL_DNS_UPSTREAM=https://1.1.1.1/dns-query,https://1.0.0.1/dns-query
deploy:
restart_policy:
condition: on-failure
pihole:
image: pihole/pihole:latest
networks:
pihole:
overlay_network:
volumes:
- "${HTPC_CONFIG_DIR}/pihole:/etc/pihole"
- "${HTPC_CONFIG_DIR}/pihole/log/pihole.log:/var/log/pihole.log"
- "${HTPC_CONFIG_DIR}/pihole/etc/dnsmasq.d:/etc/dnsmasq.d"
# allow iFrames even after container-update
# ("X-Frame-Options" in /etc/lighttpd/lighttpd.conf)
# See https://github.com/pi-hole/docker-pi-hole/issues/327
- ./pihole/allow-iframe.sh:/etc/cont-init.d/21-allow-iframe.sh
- ./pihole/whitelist.sh:/etc/cont-init.d/22-whitelist.sh
environment:
- TZ=${TZ}
- VIRTUAL_HOST=pihole.${HTPC_DOMAIN}
env_file:
- pihole.env
ports:
- 53:53/udp
- 53:53/tcp
# SOME random ports here
- 8812:443/tcp
- 8183:80/tcp
# See here how to find your Youtube IP:
# https://www.reddit.com/r/pihole/comments/9w5swx/i_think_ive_managed_to_block_youtube_ads_with/
command: /bin/bash -c "echo '172.217.168.14 manifest.googlevideo.com' >> /etc/hosts && /s6-init"
dns:
# Pihole: first dns must be 127.0.0.1
- "127.0.0.1"
# fallback
- "1.1.1.1"
deploy:
mode: replicated
restart_policy:
condition: on-failure
labels:
- traefik.enable=true
# Admin console for pihole - need to hit %/admin
- traefik.http.routers.pihole.entrypoints=websecure
- traefik.http.routers.pihole.rule=Host(`pihole.${HTPC_DOMAIN}`)
- traefik.http.routers.pihole.tls=true
- traefik.http.routers.pihole.middlewares=auth,pihole-addprefix
- traefik.http.routers.pihole.service=pihole
- traefik.http.middlewares.pihole-addprefix.addPrefix.prefix=/admin
- traefik.http.services.pihole.loadbalancer.server.port=80
networks:
overlay_network:
external: true
pihole: