diff --git a/docker/pi-hole/README.md b/docker/pi-hole/README.md index 4ad76d3..07b26c3 100644 --- a/docker/pi-hole/README.md +++ b/docker/pi-hole/README.md @@ -1,5 +1,13 @@ # Pi-hole +## TL;DR + +```sh +# Run on Raspberry Pi. +sudo apt update && sudo apt install -y docker-compose +cd pi-hole && sudo docker-compose up -d +``` + ## Further readings - [Github] diff --git a/docker/pi-hole/docker-compose.yml b/docker/pi-hole/docker-compose.yml index d8d6fe3..6bb3506 100644 --- a/docker/pi-hole/docker-compose.yml +++ b/docker/pi-hole/docker-compose.yml @@ -1,30 +1,36 @@ version: "3.2" +secrets: + webpassword: + file: ./webpassword + services: pihole: container_name: pihole image: pihole/pihole:latest - ports: - - "53:53/tcp" - - "53:53/udp" - - "67:67/udp" - - "80:80/tcp" - - "443:443/tcp" environment: TZ: Europe/Amsterdam WEBPASSWORD_FILE: /run/secrets/webpassword + # DNSMASQ_LISTENING: all # Only required if using Docker's default 'bridge' network setting volumes: - - ./etc-pihole/:/etc/pihole/ - - ./etc-dnsmasq.d/:/etc/dnsmasq.d/ + - ./etc-pihole:/etc/pihole + - ./etc-dnsmasq.d:/etc/dnsmasq.d dns: - 127.0.0.1 - 1.1.1.1 - cap_add: - - NET_ADMIN restart: unless-stopped secrets: - webpassword -secrets: - webpassword: - file: ./webpassword + # If using the container's DHCP server it is recommended to replace the + # 'ports' definition with the 'network_mode' definition instead. + network_mode: "host" + # ports: + # - "53:53/tcp" + # - "53:53/udp" + # - "67:67/udp" # Only required if using the DHCP server component. + # - "80:80/tcp" + + # Only required if using the DHCP server component. + # cap_add: + # - NET_ADMIN diff --git a/docker/pi-hole/upstream.docker-compose.yml b/docker/pi-hole/upstream.docker-compose.yml index 0f0cac5..3855c7d 100644 --- a/docker/pi-hole/upstream.docker-compose.yml +++ b/docker/pi-hole/upstream.docker-compose.yml @@ -5,24 +5,20 @@ services: pihole: container_name: pihole image: pihole/pihole:latest + # For DHCP it is recommended to remove these ports and instead add: network_mode: "host" ports: - "53:53/tcp" - "53:53/udp" - - "67:67/udp" + - "67:67/udp" # Only required if you are using Pi-hole as your DHCP server - "80:80/tcp" - - "443:443/tcp" environment: TZ: 'America/Chicago' # WEBPASSWORD: 'set a secure password here or it will be random' # Volumes store your data between container upgrades volumes: - - './etc-pihole/:/etc/pihole/' - - './etc-dnsmasq.d/:/etc/dnsmasq.d/' - dns: - - 127.0.0.1 - - 1.1.1.1 - # Recommended but not required (DHCP needs NET_ADMIN) + - './etc-pihole:/etc/pihole' + - './etc-dnsmasq.d:/etc/dnsmasq.d' # https://github.com/pi-hole/docker-pi-hole#note-on-capabilities cap_add: - - NET_ADMIN + - NET_ADMIN # Required if you are using Pi-hole as your DHCP server, else not needed restart: unless-stopped