docker-compose-configs/invidious/invidious-all/docker-compose.yml

148 lines
4.2 KiB
YAML

# Docker compose file for inv.nadeko.net
# https://docs.docker.com/compose/how-tos/multiple-compose-files/include/
include:
- ../valkey-invidious/docker-compose.yml
# https://docs.docker.com/reference/compose-file/extension/
x-common-env: &common-env
INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml"
INVIDIOUS_REDIS_URL: "tcp://valkey:6379"
# TODO: Support I2P
INVIDIOUS_ALTERNATIVE_DOMAINS: '["inv.nadeko.net", "inv.nadekonw7plitnjuawu6ytjsl7jlglk2t6pyq6eftptmiv3dvqndwvyd.onion"]'
INVIDIOUS_BACKEND_DOMAINS: '["inv1.nadeko.net", "inv2.nadeko.net", "inv3.nadeko.net", "inv4.nadeko.net", "inv5.nadeko.net"]'
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:
# Volume is not needed anymore since I use pgbouncer now
# - /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw
- ./config.yml:/etc/invidious/config.yml:ro
logging:
driver: none
# Watchtower checks in intervals of 60 seconds for fast container updates.
# It needs to have a scope or Watchtower will spam docker servers asking
# for a new image update therefore rate limiting me
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", "haproxy"]
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", "haproxy2"]
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", "haproxy3"]
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", "haproxy4"]
invidious5:
<<: *common
environment:
<<: *common-env
INVIDIOUS_INVIDIOUS_COMPANION: '[{"private_url": "https://inv-us1.nadeko.net:8448", "public_url": "https://inv-us1.nadeko.net:8448"}]'
networks: ["invidious5"]
depends_on: ["valkey5", "haproxy5"]
# 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"]
haproxy5:
<<: *common-haproxy
ports:
- "127.0.0.1:11105:8001"
- "127.0.0.1:11115:8404"
networks: ["invidious5"]
pgbouncer:
image: edoburu/pgbouncer
restart: unless-stopped
env_file:
- .env
environment:
- POOL_MODE=transaction
# Everything is being done locally
- AUTH_TYPE=trust
mem_limit: "128m"
volumes:
- /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw
networks: ["invidious", "invidious2", "invidious3", "invidious4", "invidious5"]
networks:
invidious:
name: invidious
invidious2:
name: invidious2
invidious3:
name: invidious3
invidious4:
name: invidious4
invidious5:
name: invidious5