Browsed by
Tag: pi-hole

Pi-Hole on Docker Swarm (behind SSL proxy)

Pi-Hole on Docker Swarm (behind SSL proxy)

This is my simple config for running Pi-Hole on Docker Swarm. pfsense is configured as a DNS forwarder pulling from three dockerswarm nodes. I only run one instance of Pi-Hole (they need to lock the sqlite db), but docker swarm takes care of availability/resiliency.

As I hit Pi-Hole through an SSL terminating proxy I set the ServerIP as 0.0.0.0. This resolves blocked domains to 0.0.0.0 with no major side effects.

docker service create --name pihole \
    --mount type=bind,src=/data/docker/pihole/pihole,dst=/etc/pihole \
    --mount type=bind,src=/data/docker/pihole/dnsmasq.d,dst=/etc/dnsmasq.d \
    --replicas=1 \
    -e ServerIP=0.0.0.0 \
    -e VIRTUAL_HOST=pihole.my.domain \
    -e WEBPASSWORD=myPassword \
    --publish published=9053,target=80,protocol=tcp \
    --publish published=53,target=53,protocol=tcp \
    --publish published=53,target=53,protocol=udp \
     diginc/pi-hole:debian_dev