Skip to content

Instantly share code, notes, and snippets.

@willmasters
Forked from stjohnjohnson/Makefile
Created October 12, 2023 18:58
Show Gist options
  • Save willmasters/21d0ec3a2149435b882a35f919f7e280 to your computer and use it in GitHub Desktop.
Save willmasters/21d0ec3a2149435b882a35f919f7e280 to your computer and use it in GitHub Desktop.
version: '3'
services:
pihole:
image: pihole/pihole
hostname: pihole
restart: unless-stopped
ports:
- 53:53/tcp
- 53:53/udp
- 80:80/tcp
dns:
- 127.0.0.1
- 1.1.1.1
volumes:
- ./internal.conf:/etc/dnsmasq.d/02-internal.conf
- ./internal.list:/etc/pihole/internal.list
environment:
ServerIP: "10.0.0.205"
addn-hosts=/etc/pihole/internal.list
# This is a single domain to a server
10.0.0.210 plex.example.com
# Multiple domains can point to the same server
# (routed via different ports or a proxy like nginx)
10.0.0.205 haas.example.com
10.0.0.205 pihole.example.com
# Here is an example of short name
# (useful for things like short-url services)
10.0.0.215 go
# IPs do not need to be in your network
192.168.100.1 modem
all: build test clean
test:
@echo "========== Internal Domains =========="
dig @127.0.0.1 haas.example.com +short
dig @127.0.0.1 pihole.example.com +short
dig @127.0.0.1 plex.example.com +short
dig @127.0.0.1 go +short
dig @127.0.0.1 modem +short
@echo "========== External Domains =========="
dig @127.0.0.1 google.com +short
dig @127.0.0.1 github.com +short
build:
docker-compose up -d
until curl -f -I http://127.0.0.1; do sleep 1; done
clean:
docker-compose down -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment