Skip to content

Instantly share code, notes, and snippets.

@basst85
Last active August 7, 2020 21:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save basst85/830b912e68e740d9eeb6a74d8b972015 to your computer and use it in GitHub Desktop.
Save basst85/830b912e68e740d9eeb6a74d8b972015 to your computer and use it in GitHub Desktop.
pihole_cloudflared.yml
version: "3.5"
services:
pihole:
image: pihole/pihole:latest
container_name: pihole
hostname: pihole
networks:
dockernet:
ipv4_address: 172.19.0.2
ports:
- "67:67/udp"
environment:
- "TZ=Europe/Amsterdam"
- "WEBPASSWORD=replace_this"
- "VIRTUAL_HOST=replace_this.com"
- "DNS1=172.19.0.3#5053"
- "DNS2=no"
volumes:
- "./etc-pihole/:/etc/pihole/"
- "./etc-dnsmasq.d/:/etc/dnsmasq.d/"
dns:
- "172.19.0.3#5053"
- "1.1.1.1" #fallback
restart: unless-stopped
cloudflared:
image: crazymax/cloudflared:latest
container_name: cloudflared
hostname: cloudflared
networks:
dockernet:
ipv4_address: 172.19.0.3
environment:
- "TZ=Europe/Amsterdam"
- "TUNNEL_DNS_UPSTREAM=https://dns.nextdns.io/dns-query"
restart: unless-stopped
openvpn:
image: kylemanna/openvpn:latest
container_name: openvpn
hostname: openvpn
networks:
dockernet:
ipv4_address: 172.19.0.4
ports:
- "1194:1194/udp"
volumes:
- "/etc/openvpn:/etc/openvpn"
restart: unless-stopped
cap_add:
- NET_ADMIN
nginx:
image: nginx:latest
container_name: nginx
hostname: nginx
networks:
dockernet:
ipv4_address: 172.19.0.5
volumes:
- "./data/nginx:/etc/nginx/conf.d"
- "./data/certbot/conf:/etc/letsencrypt"
- "./data/certbot/www:/var/www/certbot"
ports:
- "80:80"
- "443:443"
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
restart: unless-stopped
certbot:
image: certbot/certbot
container_name: certbot
hostname: certbot
networks:
dockernet:
ipv4_address: 172.19.0.6
volumes:
- "./data/certbot/conf:/etc/letsencrypt"
- "./data/certbot/www:/var/www/certbot"
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
restart: unless-stopped
networks:
dockernet:
ipam:
config:
- subnet: 172.19.0.0/24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment