Skip to content

Instantly share code, notes, and snippets.

@g3rhard
Created July 10, 2019 06:01
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save g3rhard/4e300ba26d3839ffddc210ff9e1c68d6 to your computer and use it in GitHub Desktop.
Save g3rhard/4e300ba26d3839ffddc210ff9e1c68d6 to your computer and use it in GitHub Desktop.
docker-compose for ipsec vpn + pihole + telegram proxy
version: '2'
services:
pihole:
image: pihole/pihole:latest
container_name: pihole
volumes:
- /etc/localtime:/etc/localtime:ro
- /dev/rtc:/dev/rtc:ro
dns:
- 1.1.1.1
expose:
- "80"
- "53"
env_file:
- pihole-variables.env
logging:
driver: "none"
networks:
network_vpn:
ipv4_address: 172.20.0.2
restart: always
tgdante2:
image: schors/tgdante2:latest
container_name: tgdante2
dns:
- 172.20.0.2
ports:
- "1080:1080"
volumes:
- /var/data/docker/tgdante2/etc:/etc
- /etc/localtime:/etc/localtime:ro
- /dev/rtc:/dev/rtc:ro
logging:
driver: "none"
networks:
network_vpn:
ipv4_address: 172.20.0.3
restart: always
vpn:
image: hwdsl2/ipsec-vpn-server:latest
container_name: ipsec-vpn-server
dns:
- 172.20.0.2
ports:
- "500:500/udp"
- "4500:4500/udp"
privileged: true
volumes:
- /lib/modules:/lib/modules:ro
env_file:
- vpn-variables.env
cap_add:
- NET_ADMIN
logging:
driver: "none"
networks:
network_vpn:
ipv4_address: 172.20.0.4
restart: always
networks:
network_vpn:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.20.0.0/16
TZ: UTC
DNS1: 1.1.1.1
DNS2: 1.0.0.1
ServerIP: 172.20.0.2
VIRTUAL_HOST: pi.hole
VIRTUAL_PORT: 80
NETWORK_ACCESS: internal
WEBPASSWORD: 'PASSWORD'
# Define your own values for these variables
# - DO NOT put "" or '' around values, or add space around =
# - DO NOT use these special characters within values: \ " '
VPN_IPSEC_PSK=IPSEC_PSK
VPN_USER=MAIN_USER
VPN_PASSWORD=MAIN_PASSWORD
# (Optional) Define additional VPN users
# - Uncomment and replace with your own values
# - Usernames and passwords must be separated by spaces
VPN_ADDL_USERS=USER1 USER2 USER3
VPN_ADDL_PASSWORDS=PASS1 PASS2 PASS3
# (Optional) Use alternative DNS servers
# - By default, clients are set to use Google Public DNS
# - Example below shows using Cloudflare's DNS service
VPN_DNS_SRV1=172.20.0.2
VPN_DNS_SRV2=1.1.1.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment