From 2ee6ae4a174a14952432e7b550ca3bb3a6b2047a Mon Sep 17 00:00:00 2001 From: Chris Crowe <425808+chriscrowe@users.noreply.github.com> Date: Tue, 16 Mar 2021 01:43:20 -0700 Subject: [PATCH] Bridge networking + new env vars (#36) * Changing to bridge networking * Adding volume declarations * Updating readme with Portainer volumes note * Adding env var for HOSTNAME * Adding env var for DOMAIN_NAME --- one-container/README.md | 9 +++++++++ one-container/docker-compose.yaml | 16 +++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/one-container/README.md b/one-container/README.md index 8ac14ab..17bba1f 100644 --- a/one-container/README.md +++ b/one-container/README.md @@ -37,6 +37,15 @@ REV_SERVER_TARGET=192.168.1.1 REV_SERVER_CIDR=192.168.0.0/16 ``` +### Using Portainer stacks? + +Portainer stacks are a little weird and don't want you to declare your named volumes, so remove this block from the top of the `docker-compose.yaml` file before copy/pasting into Portainer's stack editor: + +```yaml +volumes: + etc_pihole-unbound: + etc_pihole_dnsmasq-unbound: +``` ### Running the stack diff --git a/one-container/docker-compose.yaml b/one-container/docker-compose.yaml index 51d88bc..be66ef1 100644 --- a/one-container/docker-compose.yaml +++ b/one-container/docker-compose.yaml @@ -1,17 +1,20 @@ version: '2' +volumes: + etc_pihole-unbound: + etc_pihole_dnsmasq-unbound: services: pihole: container_name: pihole image: cbcrowe/pihole-unbound:latest - hostname: pihole - domainname: pihole.local + hostname: ${HOSTNAME} + domainname: ${DOMAIN_NAME} ports: - - 443/tcp - - 53/tcp - - 53/udp - - 80/tcp + - 443:443/tcp + - 53:53/tcp + - 53:53/udp + - 80:80/tcp # - 22/tcp # Uncomment to enable SSH environment: ServerIP: ${ServerIP} @@ -24,7 +27,6 @@ services: DNS1: 127.0.0.1#5335 # Hardcoded to our Unbound server DNS2: 127.0.0.1#5335 # Hardcoded to our Unbound server DNSSEC: "true" # Enable DNSSEC - network_mode: "host" volumes: - etc_pihole-unbound:/etc/pihole:rw - etc_pihole_dnsmasq-unbound:/etc/dnsmasq.d:rw