2024-03-05 20:59:17 +01:00
|
|
|
{pkgs, ...}: {
|
|
|
|
project.name = "dns";
|
|
|
|
|
|
|
|
networks.dmz = {
|
|
|
|
name = "dmz";
|
|
|
|
external = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
networks.dns = {
|
|
|
|
name = "dns";
|
|
|
|
driver = "bridge";
|
|
|
|
ipam.config = [
|
|
|
|
{
|
|
|
|
subnet = "172.28.1.0/24";
|
|
|
|
ip_range = "172.28.1.5/30";
|
|
|
|
gateway = "172.28.1.1";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
|
|
|
pihole.service = {
|
|
|
|
image = "pihole/pihole:latest";
|
|
|
|
container_name = "pihole";
|
2024-03-17 15:18:23 +01:00
|
|
|
hostname = "pihole";
|
2024-03-05 20:59:17 +01:00
|
|
|
environment = {
|
|
|
|
IPv6 = "True";
|
|
|
|
TZ = "Europe/Berlin";
|
|
|
|
SKIPGRAVITYONBOOT = 1;
|
|
|
|
VIRTUAL_HOST = "pihole.ghoscht.com";
|
|
|
|
};
|
|
|
|
volumes = [
|
2024-03-17 15:18:23 +01:00
|
|
|
"/drives/hdd/docker/dns/pihole_data:/etc/pihole"
|
|
|
|
"/drives/hdd/docker/dns/pihole_dnsmasq:/etc/dnsmasq.d"
|
2024-03-05 20:59:17 +01:00
|
|
|
];
|
|
|
|
labels = {
|
|
|
|
"traefik.enable" = "true";
|
|
|
|
"traefik.http.routers.pihole.entrypoints" = "websecure";
|
|
|
|
"traefik.http.routers.pihole.rule" = "Host(`pihole.ghoscht.com`)";
|
|
|
|
"traefik.http.services.pihole.loadbalancer.server.port" = "80";
|
2024-03-06 11:16:42 +01:00
|
|
|
"traefik.docker.network" = "dmz";
|
2024-03-05 20:59:17 +01:00
|
|
|
"traefik.http.routers.pihole.tls" = "true";
|
|
|
|
"traefik.http.routers.pihole.tls.certresolver" = "letsencrypt";
|
|
|
|
};
|
|
|
|
restart = "always";
|
|
|
|
networks = {
|
|
|
|
dmz = {};
|
|
|
|
dns = {
|
|
|
|
ipv4_address = "172.28.1.6";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
dns = [
|
|
|
|
"1.1.1.1"
|
|
|
|
];
|
|
|
|
capabilities = {
|
|
|
|
NET_ADMIN = true;
|
|
|
|
};
|
|
|
|
ports = [
|
|
|
|
"8420:80"
|
|
|
|
"53:53/tcp"
|
|
|
|
"53:53/udp"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
unbound.service = {
|
|
|
|
image = "mvance/unbound:latest";
|
|
|
|
container_name = "unbound";
|
|
|
|
useHostStore = true;
|
|
|
|
volumes = [
|
2024-03-17 15:18:23 +01:00
|
|
|
"/drives/hdd/docker/dns/unbound_data:/opt/unbound/etc/unbound"
|
2024-03-05 20:59:17 +01:00
|
|
|
];
|
|
|
|
restart = "always";
|
|
|
|
networks = {
|
|
|
|
dns = {
|
|
|
|
ipv4_address = "172.28.1.5";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
dns = [
|
|
|
|
"1.1.1.1"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|