diff options
-rwxr-xr-x | .env | 5 | ||||
-rwxr-xr-x | dhcp_helper/Dockerfile | 4 | ||||
-rwxr-xr-x | docker-compose.yml | 73 | ||||
-rwxr-xr-x | restartdns.sh | 3 |
4 files changed, 85 insertions, 0 deletions
@@ -0,0 +1,5 @@ +EMAIL=tobyv13@gmail.com +DOMAIN=tobyvin.com +INTERFACE=eth0 +SERVER_IP=192.168.1.2 +UPSTREAM_DNS=1.1.1.1 diff --git a/dhcp_helper/Dockerfile b/dhcp_helper/Dockerfile new file mode 100755 index 0000000..51c95b6 --- /dev/null +++ b/dhcp_helper/Dockerfile @@ -0,0 +1,4 @@ +FROM alpine:latest +RUN apk --no-cache add dhcp-helper +EXPOSE 67 67/udp +ENTRYPOINT ["dhcp-helper", "-n"]
\ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100755 index 0000000..c3c08f2 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,73 @@ +version: "3" + +services: + pihole: + image: pihole/pihole + container_name: pihole + hostname: pihole + cap_add: + - NET_ADMIN + secrets: + - webpassword + environment: + - ADMIN_EMAIL=$EMAIL + - TZ=America/Chicago + - VIRTUAL_HOST=pihole.$DOMAIN + - WEBPASSWORD=/run/secrets/webpassword + - ServerIP=$SERVER_IP + - INTERFACE=$INTERFACE + - DNS1=172.31.1.3#5053 + - DNS2=172.31.1.3#5053 + - DNSMASQ_LISTENING=all + volumes: + - ./data/pihole:/etc/pihole + - ./data/dnsmasq.d:/etc/dnsmasq.d + networks: + proxy: + default: + ipv4_address: 172.31.1.2 + dns: + - 172.31.1.3#5053 + - $UPSTREAM_DNS + ports: + - 80:80/tcp + - 53:53/tcp + - 53:53/udp + depends_on: + - dhcp_helper + restart: unless-stopped + labels: + - traefik.enable=true + - traefik.http.routers.pihole.entrypoints=websecure + + unbound: + image: klutchell/unbound + container_name: unbound + networks: + default: + ipv4_address: 172.31.1.3 + ports: + - 5053:5053/udp + restart: unless-stopped + + dhcp_helper: + build: ./dhcp_helper + container_name: dhcp_helper + cap_add: + - NET_ADMIN + network_mode: "host" + command: -s 172.31.1.2 + restart: unless-stopped + +secrets: + webpassword: + file: ./secrets/webpassword + +networks: + proxy: + external: true + default: + name: pihole + ipam: + config: + - subnet: 172.31.1.0/16 diff --git a/restartdns.sh b/restartdns.sh new file mode 100755 index 0000000..840a72a --- /dev/null +++ b/restartdns.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker-compose exec pihole pihole restartdns
\ No newline at end of file |