Skip to content

Instantly share code, notes, and snippets.

@meehatpa
Created December 12, 2023 15:48
Show Gist options
  • Save meehatpa/b2d3dd8127ef4a17837bf0da167bbfcc to your computer and use it in GitHub Desktop.
Save meehatpa/b2d3dd8127ef4a17837bf0da167bbfcc to your computer and use it in GitHub Desktop.
Pi-hole on wireguard client
---
version: "2.1"
networks:
private_network:
name: internal
ipam:
driver: default
config:
- subnet: 10.100.0.0/24
services:
wireguard:
image: lscr.io/linuxserver/wireguard:latest
container_name: wireguard
hostname: wireguard
cap_add:
- NET_ADMIN
environment:
- PUID=1000
- PGID=1000
- TZ=Asia/Kolkata
- ALLOWEDIPS=0.0.0.0/0 #optional
volumes:
- ./config:/config
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
restart: unless-stopped
dns:
- 127.0.0.1
- 10.100.0.200 # Points to unbound
networks:
private_network:
ipv4_address: 10.100.0.10
unbound:
image: "pedantic/unbound:latest"
container_name: unbound
restart: unless-stopped
hostname: "unbound"
volumes:
- "./unbound:/opt/unbound/etc/unbound/"
networks:
private_network:
ipv4_address: 10.100.0.200
pihole:
depends_on: [unbound, wireguard]
container_name: pihole
image: pihole/pihole:latest
restart: unless-stopped
environment:
TZ: "Asia/Kolkata"
WEBPASSWORD: "" # Blank password - Can be whatever you want.
ServerIP: 10.6.0.10 # Internal IP of pihole
DNS1: 10.100.0.200 # Unbound IP
DNS2: 10.100.0.200 # If we don't specify two, it will auto pick google.
volumes:
- "./etc-pihole/:/etc/pihole/"
- "./etc-dnsmasq.d/:/etc/dnsmasq.d/"
network_mode: container:wireguard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment