From b150f128b1ccc0aa8eb61cde0d4f8e1a0d87382a Mon Sep 17 00:00:00 2001 From: Fijxu Date: Tue, 5 Nov 2024 17:38:10 -0300 Subject: [PATCH] Update docker-compose.yml and provide .env --- .env | 4 +++ docker-compose.yml | 62 ++++++++++++++++++++++++++++++++++------------ 2 files changed, 50 insertions(+), 16 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..d3e3407 --- /dev/null +++ b/.env @@ -0,0 +1,4 @@ +VPN_PROVIDER="" +WIREGUARD_KEY="" +WIREGUARD_ADDRESSES="" +SERVER_HOSTNAMES="" diff --git a/docker-compose.yml b/docker-compose.yml index f4a4622..a30a4f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,22 +1,52 @@ # Docker compose file for http3-proxy used in Invidious +# IMPORTANT: Create the docker network manually before using gluetun +# sudo docker network create --subnet=172.80.0.0/16 gluetun-http3-ytproxy services: - http3-proxy: - image: git.nadeko.net/fijxu/http3-proxy:latest - restart: unless-stopped - deploy: - replicas: 6 + image: git.nadeko.net/fijxu/http3-ytproxy:latest + restart: always + # Uncomment this IF YOU ARE using gluetun! + network_mode: "service:gluetun" + # Uncomment this IF YOU ARE NOT using gluetun! + # ports: + # - "0.0.0.0:8443:8443/tcp" # HTTP/2 + # - "0.0.0.0:8443:8443/udp" # HTTP/3 (QUIC) + volumes: + - ./key.key:/app/key.key + - ./fullchain.cer:/app/fullchain.cer + command: "./http3-ytproxy -l 0.0.0.0 -p 8443 -https -tls-key ./key.key -tls-cert ./fullchain.cer" + depends_on: + - gluetun + + gluetun: + image: qmcgaw/gluetun:latest + restart: always + ports: + # THIS IS ACTUALLY THE PORT OF HTTP3-PROXY + # SINCE THE HTTP3-PTOXY SERVICE IS RUNNING + # UNDER GLUETUN NETWORK. + - "0.0.0.0:8443:8443/tcp" # HTTP/2 + - "0.0.0.0:8443:8443/udp" # HTTP/3 (QUIC) + env_file: + - .env + cap_add: + - NET_ADMIN + devices: + - /dev/net/tun:/dev/net/tun + volumes: + - ./gluetun:/gluetun environment: - DISABLE_WEBP: 1 - - http3-proxy-nginx: - image: nginx:latest - restart: unless-stopped - volumes: - - ./nginx.conf:/etc/nginx/nginx.conf:ro - depends_on: - - http3-proxy - ports: - - "127.0.0.1:10012:3000" + - VPN_SERVICE_PROVIDER="${VPN_PROVIDER}" + - VPN_TYPE=wireguard + - WIREGUARD_PRIVATE_KEY="${WIREGUARD_KEY}" + - WIREGUARD_ADDRESSES="${WIREGUARD_ADDRESSES}" + - SERVER_HOSTNAMES="${SERVER_HOSTNAMES}" + # Use system DNS (Setup a caching DNS server!) + - DNS_KEEP_NAMESERVER=on + networks: + gluetun-http3-ytproxy: +networks: + gluetun-http3-ytproxy: + external: true