I managed to get docker and the pihole image working on my pi with the following docker-compose file:
version: '3.6'
services:
pihole:
image: pihole/pihole:v5.8.1
container_name: pihole
restart: always
hostname: pihole
volumes:
- ./pihole/pihole/:/etc/pihole/
- ./pihole/dnsmasq.d/:/etc/dnsmasq.d/
#- ./pihole/log/:/var/log/ #This is not working for some reason, have to look into it.
cap_add:
- NET_ADMIN
environment:
- ServerIP=192.168.1.150
- TZ=Europe/Berlin
- PIHOLE_DNS_=1.1.1.1
- WEBPASSWORD=SomePassword #Replace this
network_mode: "host"
#Figure out a way to also add blocklists
Seems to work pretty good! But I am wondering if there is also a way to supply black, white and adlists directly in the docker-compose file somehow? This way it would be seamless to launch new containers, update and so on and not having to ad my domains manually everytime.
I found som old post doing something like this
volumes:
'./adlists.list:/etc/pihole/adlists.list'
But that does not work for me. Not sure where to put my file.
Edit:
After much searching it seems that since version 5 gravity is now using a db instead of file. There is a tool for it:
Really a shame that its not possible to specify a list or something in the docker-compose.