diff --git a/pihole/README.md b/pihole/README.md new file mode 100644 index 0000000..62ffd21 --- /dev/null +++ b/pihole/README.md @@ -0,0 +1,49 @@ +# PiHole + +## Overview + +This Docker Compose project deploys a Pi-hole DNS sinkhole and network-wide ad blocker. It centralizes DNS filtering, logging, and management behind a lightweight containerized service. + +## Project Details + +- **Project Repository:** [Link](https://pi-hole.net/) +- **Container Image:** [Docker Hub](https://hub.docker.com/r/pihole/pihole) +- **Compose Example:** [Compose](https://hub.docker.com/r/pihole/pihole) +- **Documentation:** [Docs](https://docs.docker.com/compose/install/) +- **Reverse Proxy Port:** `53 (tcp & udp), 80, 443, 67, 123` + +## Environment Variable Notes + +Below are the key environment variables commonly used with the Pi-hole container. +You can also read more here: https://hub.docker.com/r/pihole/pihole + +``` +TZ – Your timezone (e.g., "America/Toronto"). Used for correct log timestamps. +WEBPASSWORD – Password for the Pi-hole admin web interface. If omitted, a random one is generated. +DNSMASQ_LISTENING – Set to "all" to allow queries from the LAN. +ServerIP – The host machine’s LAN IP address. Required so Pi-hole can properly generate block pages. +FTLCONF_LOCAL_IPV4 – Alternative to ServerIP for newer versions; defines Pi-hole’s listening IP. +INTERFACE – Network interface Pi-hole should bind to (e.g., eth0). Optional if using host networking. +VIRTUAL_HOST – (Optional) Used with reverse proxies for URL routing. +``` + +## Volume Notes + +Pi-hole uses volumes to persist configuration and query data: + +``` +/etc/pihole – Stores Pi-hole configs, gravity lists, custom blocklists, DHCP settings, logs. +/etc/dnsmasq.d – Stores dnsmasq configuration files used by Pi-hole’s DNS service. +``` + +## Additional Notes / Gotchas + +DHCP Server: If running Pi-hole as your network DHCP server, the container must run in host networking mode to broadcast DHCP packets correctly. + +Networking: Pi-hole works best in host networking mode. If using bridge mode, you must set ServerIP and ensure port 53 (TCP/UDP) is exposed. + +Port Conflicts: Nothing else on the host may use port 53. Disable systemd-resolved or any local DNS server if necessary. + +Docker + Reverse Proxy: Pi-hole doesn’t always play nicely behind reverse proxies. If using one, forward only the admin interface (port 80) and keep DNS ports (53) exposed directly. + +Gravity Updates: Pi-hole updates blocklists daily. If using custom lists, verify they can be fetched without authentication or special headers. diff --git a/pihole/docker-compose.yml b/pihole/docker-compose.yml new file mode 100644 index 0000000..cfbedcf --- /dev/null +++ b/pihole/docker-compose.yml @@ -0,0 +1,33 @@ +services: + pihole: + image: ${PIHOLE_IMAGE:-pihole/pihole:latest} + restart: unless-stopped + volumes: + - './etc-pihole:/etc/pihole' + - './etc-dnsmasq:/etc/dnsmasq.d' + environment: + - TZ=${TZ:-America/Vancouver} + # Set a password to access the web interface. Not setting one will result in a random password being assigned + - FTLCONF_webserver_api_password=${PIHOLE_PASSWORD:-correctHorseBatteryStaple} + # If using Docker's default `bridge` network setting the dns listening mode should be set to 'ALL' + - FTLCONF_dns_listeningMode=${PIHOLE_LISTENMODE:-ALL} + ports: + # DNS Ports + - "53:53/tcp" + - "53:53/udp" + # Default HTTP Port + - "80:80/tcp" + # Default HTTPs Port. FTL will generate a self-signed certificate + - "443:443/tcp" + # Uncomment the line below if you are using Pi-hole as your DHCP server + #- "67:67/udp" + # Uncomment the line below if you are using Pi-hole as your NTP server + #- "123:123/udp" + cap_add: + # See https://github.com/pi-hole/docker-pi-hole#note-on-capabilities + # Required if you are using Pi-hole as your DHCP server, else not needed + # - NET_ADMIN + # Required if you are using Pi-hole as your NTP client to be able to set the host's system time + - SYS_TIME + # Optional, if Pi-hole should get some more processing time + - SYS_NICE diff --git a/pihole/sample.env b/pihole/sample.env new file mode 100644 index 0000000..c58d6d4 --- /dev/null +++ b/pihole/sample.env @@ -0,0 +1,4 @@ +TZ="America/Vancouver" +PIHOLE_IMAGE="pihole/pihole:latest" +PIHOLE_PASSWORD="correctHorseBatteryStaple" +PIHOLE_LISTENMODE="ALL" diff --git a/pihole_dev/README.md b/pihole_dev/README.md deleted file mode 100644 index cfc2c0a..0000000 --- a/pihole_dev/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# PiHole - -[official website](https://pi-hole.net/) - diff --git a/pihole_dev/docker-compose.yml b/pihole_dev/docker-compose.yml deleted file mode 100644 index 734b28f..0000000 --- a/pihole_dev/docker-compose.yml +++ /dev/null @@ -1,22 +0,0 @@ -services: - pihole: - image: pihole/pihole:latest - restart: unless-stopped - ports: - - "53:53/tcp" # DNS - - "53:53/udp" # DNS - - "80:80/tcp" # Web interface - environment: - TZ: "America/Vancouver" # Set your timezone - WEBPASSWORD: "your_secure_password" - DNS1: "1.1.1.1" # Upstream DNS (Cloudflare) - DNS2: "1.0.0.1" - VIRTUAL_HOST: "pihole.yourdomain.com" # Set your domain if applicable - ServerIP: "your_server_ip" # Set your server's IP address - volumes: - - './etc-pihole:/etc/pihole' - - './etc-dnsmasq:/etc/dnsmasq.d' - cap_add: - - NET_ADMIN - - diff --git a/pihole_dev/sample.env b/pihole_dev/sample.env deleted file mode 100644 index 23d19df..0000000 --- a/pihole_dev/sample.env +++ /dev/null @@ -1,3 +0,0 @@ -VOL_PATH=./data -TZ="America/Vancouver" -COMPOSE_PROJECT_NAME=pihole