update invidious config

This commit is contained in:
root 2024-12-24 21:32:31 -03:00
parent d6cd60fed2
commit 7d2d61a121
12 changed files with 122 additions and 645 deletions

View file

@ -1,45 +0,0 @@
# Docker compose file for Backend 2 of inv.nadeko.net
x-labels: &labels
labels: [ "com.centurylinklabs.watchtower.scope=invidious" ]
services:
# INVIDIOUS CLEARNET
invidious:
env_file:
# Env file containing variables like TAG, INV_MEM_*
- .env
# Env file containing INVIDIOUS_* variables
- ../.env
image: "git.nadeko.net/fijxu/invidious-with-companion:${TAG}"
restart: unless-stopped
mem_limit: ${INV_MEM_LIMIT}
mem_reservation: ${INV_MEM_RESERVATION}
cpus: ${INV_CPU} # Limit to X% of the CPU
deploy:
replicas: 4
volumes:
- /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw
- ./config.yml:/etc/invidious/config.yml:ro
environment:
INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml"
INVIDIOUS_REDIS_URL: "tcp://valkey:6379"
depends_on:
- haproxy
<<: *labels
# Without depends because haproxy is smart
haproxy:
image: haproxy:lts-alpine
restart: always
ports:
# Invidious
- "127.0.0.1:10070:8001"
# METRICS
- "127.0.0.1:10074:8404"
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
networks:
default:
name: invidious-2

View file

@ -1,108 +0,0 @@
# Docker compose file for Backend 2 of inv.nadeko.net
#https://docs.docker.com/reference/compose-file/fragments/
x-common-config: &common-config
env_file:
# Env file containing variables like TAG, INV_MEM_*
- .env
# Env file containing INVIDIOUS_* variables
- ../.env
image: "git.nadeko.net/fijxu/invidious-with-companion:${TAG}"
restart: unless-stopped
mem_limit: ${INV_MEM_LIMIT}
mem_reservation: ${INV_MEM_RESERVATION}
cpus: ${INV_CPU} # Limit to X% of the CPU
network_mode: "service:gluetun"
volumes:
- /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw
- ./config.yml:/etc/invidious/config.yml:ro
depends_on:
gluetun:
condition: service_healthy
# ptgen:
# condition: service_started
haproxy:
condition: service_started
environment: &env
INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml"
# INVIDIOUS_TOKENS_SERVER: http://gluetun:7070
services:
# INVIDIOUS CLEARNET
invidious:
<<: *common-config
environment:
<<: *env
INVIDIOUS_PORT: "3000"
invidious2:
<<: *common-config
environment:
<<: *env
INVIDIOUS_PORT: "3001"
invidious3:
<<: *common-config
environment:
<<: *env
INVIDIOUS_PORT: "3002"
invidious4:
<<: *common-config
environment:
<<: *env
INVIDIOUS_PORT: "3003"
haproxy:
image: haproxy:lts-alpine
restart: unless-stopped
ports:
# Invidious
- "127.0.0.1:10070:8001"
# METRICS
- "127.0.0.1:10074:8404"
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
networks:
gluetun_network:
depends_on:
- gluetun
gluetun:
image: qmcgaw/gluetun
restart: unless-stopped
env_file:
- .env
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
volumes:
- ./gluetun:/gluetun
environment:
- VPN_SERVICE_PROVIDER=mullvad
- VPN_TYPE=wireguard
- WIREGUARD_PRIVATE_KEY="${WIREGUARD_KEY}"
- WIREGUARD_ADDRESSES="${WIREGUARD_ADDRESSES}"
- SERVER_HOSTNAMES="${SERVER_HOSTNAMES}"
- DNS_KEEP_NAMESERVER=on
networks:
gluetun_network:
# ptgen:
# image: git.nadeko.net/fijxu/youtube-po-token-generator:latest
# cpus: 0.1
# restart: unless-stopped
# network_mode: "service:gluetun"
# environment:
# - PORT=7070
# depends_on:
# - gluetun
networks:
default:
name: invidious-vpn
gluetun_network:
external: true

View file

@ -1,44 +0,0 @@
global
# This because haproxy is dumb and likes to use the maxconnection from the kernel and that is super mega huge making haproxy oom
maxconn 8192
# 777 perms for all sockets
unix-bind mode 777
stats socket ipv4@0.0.0.0:8405 level admin
resolvers docker
# To be able to use multiple replicas of invidious
# using domains
nameserver dns1 127.0.0.11:53
defaults
mode http
# https://www.haproxy.com/documentation/haproxy-configuration-tutorials/service-reliability/retries/
# Use another server if one takes too long to reply
retries 2
option redispatch
timeout client 30s
timeout connect 30s
timeout server 120s
timeout queue 10s
http-reuse always
# Prometheus for graphs
frontend prometheus
bind *:8404
mode http
http-request use-service prometheus-exporter if { path /metrics }
no log
frontend invidious
bind *:8001
default_backend invidious
backend invidious
balance roundrobin
server-template invidious 8 invidious:3000 check resolvers docker init-addr libc,none
# server invidious-1-vpn gluetun:3000 check init-addr libc,none
# server invidious-2-vpn gluetun:3001 check init-addr libc,none
# server invidious-3-vpn gluetun:3002 check init-addr libc,none
# server invidious-4-vpn gluetun:3003 check init-addr libc,none
# server invidious-5-vpn gluetun:3004 check init-addr libc,none
# server invidious-6-vpn gluetun:3005 check init-addr libc,none

View file

@ -1,45 +0,0 @@
# Docker compose file for Backend 3 of inv.nadeko.net
x-labels: &labels
labels: [ "com.centurylinklabs.watchtower.scope=invidious" ]
services:
# INVIDIOUS CLEARNET
invidious:
env_file:
# Env file containing variables like TAG, INV_MEM_*
- .env
# Env file containing INVIDIOUS_* variables
- ../.env
image: "git.nadeko.net/fijxu/invidious-with-companion:${TAG}"
restart: unless-stopped
mem_limit: ${INV_MEM_LIMIT}
mem_reservation: ${INV_MEM_RESERVATION}
cpus: ${INV_CPU} # Limit to X% of the CPU
deploy:
replicas: 4
volumes:
- /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw
- ./config.yml:/etc/invidious/config.yml:ro
environment:
INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml"
INVIDIOUS_REDIS_URL: "tcp://valkey:6379"
depends_on:
- haproxy
<<: *labels
# Without depends because haproxy is smart
haproxy:
image: haproxy:lts-alpine
restart: always
ports:
# Invidious
- "127.0.0.1:10080:8001"
# METRICS
- "127.0.0.1:10084:8404"
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
networks:
default:
name: invidious-3

View file

@ -1,107 +0,0 @@
# Docker compose file for Backend 3 of inv.nadeko.net
#https://docs.docker.com/reference/compose-file/fragments/
x-common-config: &common-config
env_file:
# Env file containing variables like TAG, INV_MEM_*
- .env
# Env file containing INVIDIOUS_* variables
- ../.env
image: "git.nadeko.net/fijxu/invidious-with-companion:${TAG}"
restart: unless-stopped
mem_limit: ${INV_MEM_LIMIT}
mem_reservation: ${INV_MEM_RESERVATION}
cpus: ${INV_CPU} # Limit to X% of the CPU
network_mode: "service:gluetun"
volumes:
- /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw
- ./config.yml:/etc/invidious/config.yml:ro
depends_on:
gluetun:
condition: service_healthy
# ptgen:
# condition: service_started
haproxy:
condition: service_started
environment: &env
INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml"
# INVIDIOUS_TOKENS_SERVER: http://gluetun:7070
services:
# INVIDIOUS CLEARNET
invidious:
<<: *common-config
environment:
<<: *env
INVIDIOUS_PORT: "3000"
invidious2:
<<: *common-config
environment:
<<: *env
INVIDIOUS_PORT: "3001"
invidious3:
<<: *common-config
environment:
<<: *env
INVIDIOUS_PORT: "3002"
invidious4:
<<: *common-config
environment:
<<: *env
INVIDIOUS_PORT: "3003"
haproxy:
image: haproxy:lts-alpine
restart: unless-stopped
ports:
# Invidious
- "127.0.0.1:10080:8001"
# METRICS
- "127.0.0.1:10084:8404"
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
networks:
gluetun_network_2:
depends_on:
- gluetun
gluetun:
image: qmcgaw/gluetun
restart: unless-stopped
env_file:
- .env
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
volumes:
- ./gluetun:/gluetun
environment:
- VPN_SERVICE_PROVIDER=mullvad
- VPN_TYPE=wireguard
- WIREGUARD_PRIVATE_KEY="${WIREGUARD_KEY}"
- WIREGUARD_ADDRESSES="${WIREGUARD_ADDRESSES}"
- SERVER_HOSTNAMES="${SERVER_HOSTNAMES}"
- DNS_KEEP_NAMESERVER=on
networks:
gluetun_network_2:
# ptgen:
# image: git.nadeko.net/fijxu/youtube-po-token-generator:latest
# cpus: 0.1
# restart: unless-stopped
# network_mode: "service:gluetun"
# environment:
# - PORT=7070
# depends_on:
# - gluetun
networks:
default:
name: invidious-vpn-2
gluetun_network_2:
external: true

View file

@ -1,45 +0,0 @@
global
# This because haproxy is dumb and likes to use the maxconnection from the kernel and that is super mega huge making haproxy oom
maxconn 8192
# 777 perms for all sockets
unix-bind mode 777
stats socket ipv4@0.0.0.0:8405 level admin
resolvers docker
# To be able to use multiple replicas of invidious
# using domains
nameserver dns1 127.0.0.11:53
defaults
mode http
# https://www.haproxy.com/documentation/haproxy-configuration-tutorials/service-reliability/retries/
# Use another server if one takes too long to reply
retries 2
option redispatch
timeout client 30s
timeout connect 30s
timeout server 120s
timeout queue 10s
http-reuse always
# Prometheus for graphs
frontend prometheus
bind *:8404
mode http
http-request use-service prometheus-exporter if { path /metrics }
no log
frontend invidious
bind *:8001
default_backend invidious
backend invidious
balance roundrobin
server-template invidious 8 invidious:3000 check resolvers docker init-addr libc,none
# server invidious-1-vpn gluetun:3000 check init-addr libc,none
# server invidious-2-vpn gluetun:3001 check init-addr libc,none
# server invidious-3-vpn gluetun:3002 check init-addr libc,none
# server invidious-4-vpn gluetun:3003 check init-addr libc,none
# server invidious-5-vpn gluetun:3004 check init-addr libc,none
# server invidious-6-vpn gluetun:3005 check init-addr libc,none

View file

@ -1,45 +0,0 @@
# Docker compose file for Backend 4 of inv.nadeko.net
x-labels: &labels
labels: [ "com.centurylinklabs.watchtower.scope=invidious" ]
services:
# INVIDIOUS CLEARNET
invidious:
env_file:
# Env file containing variables like TAG, INV_MEM_*
- .env
# Env file containing INVIDIOUS_* variables
- ../.env
image: "git.nadeko.net/fijxu/invidious-with-companion:${TAG}"
restart: unless-stopped
mem_limit: ${INV_MEM_LIMIT}
mem_reservation: ${INV_MEM_RESERVATION}
cpus: ${INV_CPU} # Limit to X% of the CPU
deploy:
replicas: 4
volumes:
- /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw
- ./config.yml:/etc/invidious/config.yml:ro
environment:
INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml"
INVIDIOUS_REDIS_URL: "tcp://valkey:6379"
depends_on:
- haproxy
<<: *labels
# Without depends because haproxy is smart
haproxy:
image: haproxy:lts-alpine
restart: always
ports:
# Invidious
- "127.0.0.1:20100:8001"
# METRICS
- "127.0.0.1:20104:8404"
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
networks:
default:
name: invidious-4

View file

@ -0,0 +1,110 @@
# Docker compose file for Backend 1 of inv.nadeko.net
# https://docs.docker.com/reference/compose-file/extension/
include:
- ../valkey-invidious/docker-compose.yml
x-common-env: &common-env
INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml"
INVIDIOUS_REDIS_URL: "tcp://valkey:6379"
x-common: &common
hostname: invidious
env_file:
# Env file containing INVIDIOUS_* variables
- .env
image: "git.nadeko.net/fijxu/invidious-with-companion:latest"
restart: unless-stopped
mem_limit: 512MB
cpus: 0.25
deploy:
replicas: 3
volumes:
- /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw
- ./config.yml:/etc/invidious/config.yml:ro
logging:
driver: none
labels: [ "com.centurylinklabs.watchtower.scope=invidious" ]
x-common-haproxy: &common-haproxy
hostname: haproxy
image: haproxy:lts-alpine
restart: always
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
services:
# INVIDIOUS SECTION #
invidious:
<<: *common
environment:
<<: *common-env
INVIDIOUS_INVIDIOUS_COMPANION: '[{"private_url": "https://inv-cl2.nadeko.net:8448", "public_url": "https://inv-cl2.nadeko.net:8448"}]'
networks: ["invidious"]
depends_on: ["valkey"]
invidious2:
<<: *common
environment:
<<: *common-env
INVIDIOUS_INVIDIOUS_COMPANION: '[{"private_url": "https://inv-ca1.nadeko.net:8448", "public_url": "https://inv-ca1.nadeko.net:8448"}]'
networks: ["invidious2"]
depends_on: ["valkey2"]
invidious3:
<<: *common
environment:
<<: *common-env
INVIDIOUS_INVIDIOUS_COMPANION: '[{"private_url": "https://inv-us2.nadeko.net:8448", "public_url": "https://inv-us2.nadeko.net:8448"}]'
networks: ["invidious3"]
depends_on: ["valkey3"]
invidious4:
<<: *common
environment:
<<: *common-env
INVIDIOUS_INVIDIOUS_COMPANION: '[{"private_url": "https://inv-eu1.nadeko.net:8448", "public_url": "https://inv-eu1.nadeko.net:8448"}]'
networks: ["invidious4"]
depends_on: ["valkey4"]
# HAPROXY SECTION #
haproxy:
<<: *common-haproxy
ports:
- "127.0.0.1:11101:8001"
- "127.0.0.1:11111:8404"
networks: ["invidious"]
haproxy2:
<<: *common-haproxy
ports:
- "127.0.0.1:11102:8001"
- "127.0.0.1:11112:8404"
networks: ["invidious2"]
haproxy3:
<<: *common-haproxy
ports:
- "127.0.0.1:11103:8001"
- "127.0.0.1:11113:8404"
networks: ["invidious3"]
haproxy4:
<<: *common-haproxy
ports:
- "127.0.0.1:11104:8001"
- "127.0.0.1:11114:8404"
networks: ["invidious4"]
networks:
invidious:
name: invidious
invidious2:
name: invidious2
invidious3:
name: invidious3
invidious4:
name: invidious4

View file

@ -1,9 +1,6 @@
global
# This because haproxy is dumb and likes to use the maxconnection from the kernel and that is super mega huge making haproxy oom
maxconn 8192
# 777 perms for all sockets
unix-bind mode 777
stats socket ipv4@0.0.0.0:8405 level admin
resolvers docker
# To be able to use multiple replicas of invidious
@ -14,12 +11,12 @@ defaults
mode http
# https://www.haproxy.com/documentation/haproxy-configuration-tutorials/service-reliability/retries/
# Use another server if one takes too long to reply
retries 2
retries 4
option redispatch
timeout client 30s
timeout connect 30s
timeout server 120s
timeout queue 10s
timeout queue 20s
http-reuse always
# Prometheus for graphs
@ -36,3 +33,4 @@ frontend invidious
backend invidious
balance roundrobin
server-template invidious 8 invidious:3000 check resolvers docker init-addr libc,none

View file

@ -1,54 +0,0 @@
# Docker compose file for Backend 1 of inv.nadeko.net
x-labels: &labels
labels: [ "com.centurylinklabs.watchtower.scope=invidious" ]
services:
# INVIDIOUS CLEARNET
invidious:
env_file:
# Env file containing variables like TAG, INV_MEM_*
- .env
# Env file containing INVIDIOUS_* variables
- ../.env
image: "git.nadeko.net/fijxu/invidious-with-companion:${TAG}"
restart: unless-stopped
mem_limit: ${INV_MEM_LIMIT}
mem_reservation: ${INV_MEM_RESERVATION}
cpus: ${INV_CPU} # Limit to X% of the CPU
deploy:
replicas: 4
volumes:
- /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw
- ./config.yml:/etc/invidious/config.yml:ro
environment:
INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml"
INVIDIOUS_REDIS_URL: "tcp://valkey:6379"
depends_on:
- haproxy
<<: *labels
# Without depends because haproxy is smart
haproxy:
image: haproxy:lts-alpine
restart: always
ports:
# Invidious
- "127.0.0.1:10060:8001"
# METRICS
- "127.0.0.1:10064:8404"
volumes:
- ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg
# ptgen:
# image: git.nadeko.net/fijxu/youtube-po-token-generator:latest
# cpus: 0.1
# restart: unless-stopped
# environment:
# - PORT=7070
# depends_on:
# - haproxy
networks:
default:
name: invidious

View file

@ -1,39 +0,0 @@
global
# This because haproxy is dumb and likes to use the maxconnection from the kernel and that is super mega huge making haproxy oom
maxconn 8192
# 777 perms for all sockets
unix-bind mode 777
# stats socket ipv4@0.0.0.0:8405 level admin
resolvers docker
# To be able to use multiple replicas of invidious
# using domains
nameserver dns1 127.0.0.11:53
defaults
mode http
# https://www.haproxy.com/documentation/haproxy-configuration-tutorials/service-reliability/retries/
# Use another server if one takes too long to reply
retries 2
option redispatch
timeout client 30s
timeout connect 30s
timeout server 120s
timeout queue 10s
http-reuse always
# Prometheus for graphs
frontend prometheus
bind *:8404
mode http
http-request use-service prometheus-exporter if { path /metrics }
no log
frontend invidious
bind *:8001
default_backend invidious
backend invidious
balance roundrobin
server-template invidious 8 invidious:3000 check resolvers docker init-addr libc,none

View file

@ -1,6 +1,6 @@
#https://docs.docker.com/reference/compose-file/fragments/
x-common-config: &common-config
# https://docs.docker.com/reference/compose-file/extension/
x-common: &common
image: valkey/valkey:7.2-alpine
hostname: valkey
restart: unless-stopped
@ -13,121 +13,22 @@ services:
# address of the backend. Is not possible to mix cache between backends.
valkey:
<<: *common-config
<<: *common
networks:
- invidious
valkey2:
<<: *common-config
<<: *common
networks:
- invidious-2
- invidious2
valkey3:
<<: *common-config
<<: *common
networks:
- invidious-3
- invidious3
valkey4:
<<: *common-config
<<: *common
networks:
- invidious-4
# valkey-2:
# image: valkey/valkey:7.2-alpine
# restart: unless-stopped
# volumes:
# - ./valkey.conf:/usr/local/etc/valkey/valkey.conf
# command: "valkey-server /usr/local/etc/valkey/valkey.conf"
# networks:
# - invidious-2
#
# valkey-3:
# image: valkey/valkey:7.2-alpine
# restart: unless-stopped
# volumes:
# - ./valkey.conf:/usr/local/etc/valkey/valkey.conf
# command: "valkey-server /usr/local/etc/valkey/valkey.conf"
# networks:
# - invidious-3
#
# valkey-4:
# image: valkey/valkey:7.2-alpine
# restart: unless-stopped
# volumes:
# - ./valkey.conf:/usr/local/etc/valkey/valkey.conf
# command: "valkey-server /usr/local/etc/valkey/valkey.conf"
# networks:
# - invidious-4
#
# valkey-companion:
# image: valkey/valkey:7.2-alpine
# restart: unless-stopped
# volumes:
# - ./valkey.conf:/usr/local/etc/valkey/valkey.conf
# command: "valkey-server /usr/local/etc/valkey/valkey.conf"
# networks:
# - invidious-companion
#
# # INVIDIOUS VALKEY METRICS
# invidious-redis-exporter:
# image: oliver006/redis_exporter
# restart: unless-stopped
# ports:
# - "127.0.0.1:9121:9121"
# command: "--redis.addr=redis://valkey:6379"
# networks:
# - invidious
#
# # INVIDIOUS VALKEY METRICS
# invidious-redis-exporter-vpn:
# image: oliver006/redis_exporter
# restart: unless-stopped
# ports:
# - "127.0.0.1:9122:9121"
# command: "--redis.addr=redis://valkey-vpn:6379"
# networks:
# - gluetun_network
#
# # INVIDIOUS VALKEY METRICS
# invidious-redis-exporter-vpn-2:
# image: oliver006/redis_exporter
# restart: unless-stopped
# ports:
# - "127.0.0.1:9123:9121"
# command: "--redis.addr=redis://valkey-vpn-2:6379"
# networks:
# - gluetun_network_2
#
# # INVIDIOUS VALKEY METRICS
# invidious-redis-exporter-external:
# image: oliver006/redis_exporter
# restart: unless-stopped
# ports:
# - "127.0.0.1:9124:9121"
# command: "--redis.addr=redis://valkey-external:6379"
# networks:
# - invidious-external
networks:
invidious:
external: true
invidious-2:
external: true
invidious-3:
external: true
invidious-4:
external: true
# gluetun_network:
# external: true
# gluetun_network_2:
# external: true
# invidious-companion:
# external: true
# volumes:
# invidious-valkey:
# invidious-valkey-vpn:
# invidious-valkey-vpn-2:
# invidious-external:
# invidious-with-companion:
- invidious4