195 lines
5.9 KiB
YAML
195 lines
5.9 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
|
|
#- ../invidious-companion/docker-compose.yml
|
|
|
|
# https://docs.docker.com/reference/compose-file/extension/
|
|
x-common-invidious-env: &common-invidious-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", "inv1.nadekonw7plitnjuawu6ytjsl7jlglk2t6pyq6eftptmiv3dvqndwvyd.onion", "inv2.nadekonw7plitnjuawu6ytjsl7jlglk2t6pyq6eftptmiv3dvqndwvyd.onion", "inv3.nadekonw7plitnjuawu6ytjsl7jlglk2t6pyq6eftptmiv3dvqndwvyd.onion", "inv4.nadekonw7plitnjuawu6ytjsl7jlglk2t6pyq6eftptmiv3dvqndwvyd.onion", "inv5.nadekonw7plitnjuawu6ytjsl7jlglk2t6pyq6eftptmiv3dvqndwvyd.onion"]'
|
|
|
|
# https://docs.docker.com/reference/compose-file/extension/
|
|
x-common-dep: &common-dep
|
|
depends_on: ["pgbouncer"]
|
|
|
|
x-common: &common-invidious
|
|
#hostname: invidious
|
|
env_file:
|
|
# Env file containing INVIDIOUS_* variables
|
|
- .env
|
|
image: "git.nadeko.net/fijxu/invidious:latest"
|
|
restart: always
|
|
mem_limit: 780MB
|
|
cpus: 0.50
|
|
deploy:
|
|
replicas: 1
|
|
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
|
|
# 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
|
|
|
|
x-common-anubis-env: &common-anubis-env
|
|
DIFFICULTY: "2"
|
|
SERVE_ROBOTS_TXT: "true"
|
|
BIND: "0.0.0.0:4000"
|
|
METRICS_BIND: "0.0.0.0:9090"
|
|
POLICY_FNAME: "/data/cfg/botPolicy.json"
|
|
|
|
x-common-anubis: &common-anubis
|
|
image: git.nadeko.net/fijxu/anubis:latest
|
|
restart: always
|
|
volumes:
|
|
- "./botPolicy.json:/data/cfg/botPolicy.json:ro"
|
|
labels:
|
|
- "com.centurylinklabs.watchtower.enable=true"
|
|
|
|
services:
|
|
|
|
# INVIDIOUS SECTION #
|
|
invidious:
|
|
<<: *common-invidious
|
|
environment:
|
|
<<: *common-invidious-env
|
|
INVIDIOUS_INVIDIOUS_COMPANION: '[{"private_url": "https://inv-cl2-c.nadeko.net:8443", "public_url": "https://inv-cl2-c.nadeko.net:8443"}]'
|
|
networks: ["invidious"]
|
|
depends_on: ["valkey"]
|
|
|
|
invidious2:
|
|
<<: *common-invidious
|
|
environment:
|
|
<<: *common-invidious-env
|
|
INVIDIOUS_INVIDIOUS_COMPANION: '[{"private_url": "https://inv-ca1-c.nadeko.net", "public_url": "https://inv-ca1-c.nadeko.net"}]'
|
|
networks: ["invidious2"]
|
|
depends_on: ["valkey2"]
|
|
|
|
invidious3:
|
|
<<: *common-invidious
|
|
environment:
|
|
<<: *common-invidious-env
|
|
INVIDIOUS_INVIDIOUS_COMPANION: '[{"private_url": "https://inv-us2-c.nadeko.net", "public_url": "https://inv-us2-c.nadeko.net"}]'
|
|
networks: ["invidious3"]
|
|
depends_on: ["valkey3"]
|
|
|
|
invidious4:
|
|
<<: *common-invidious
|
|
environment:
|
|
<<: *common-invidious-env
|
|
INVIDIOUS_INVIDIOUS_COMPANION: '[{"private_url": "https://inv-eu3-c.nadeko.net", "public_url": "https://inv-eu3-c.nadeko.net"}]'
|
|
networks: ["invidious4"]
|
|
depends_on: ["valkey4"]
|
|
|
|
invidious5:
|
|
<<: *common-invidious
|
|
environment:
|
|
<<: *common-invidious-env
|
|
INVIDIOUS_INVIDIOUS_COMPANION: '[{"private_url": "https://inv-eu2-c.nadeko.net", "public_url": "https://inv-eu2-c.nadeko.net"}]'
|
|
networks: ["invidious5"]
|
|
depends_on: ["valkey5"]
|
|
|
|
# ANUBIS SECTION #
|
|
|
|
anubis-inv:
|
|
<<: *common-anubis
|
|
environment:
|
|
<<: *common-anubis-env
|
|
TARGET: "http://invidious:3000"
|
|
COOKIE: "anubis.inv1"
|
|
networks: ["invidious"]
|
|
ports:
|
|
- 127.0.0.1:9051:9090
|
|
|
|
anubis-inv2:
|
|
<<: *common-anubis
|
|
environment:
|
|
<<: *common-anubis-env
|
|
TARGET: "http://invidious2:3000"
|
|
COOKIE: "anubis.inv2"
|
|
networks: ["invidious2"]
|
|
ports:
|
|
- 127.0.0.1:9052:9090
|
|
|
|
anubis-inv3:
|
|
<<: *common-anubis
|
|
environment:
|
|
<<: *common-anubis-env
|
|
TARGET: "http://invidious3:3000"
|
|
COOKIE: "anubis.inv3"
|
|
networks: ["invidious3"]
|
|
ports:
|
|
- 127.0.0.1:9053:9090
|
|
|
|
anubis-inv4:
|
|
<<: *common-anubis
|
|
environment:
|
|
<<: *common-anubis-env
|
|
TARGET: "http://invidious4:3000"
|
|
COOKIE: "anubis.inv4"
|
|
networks: ["invidious4"]
|
|
ports:
|
|
- 127.0.0.1:9054:9090
|
|
|
|
anubis-inv5:
|
|
<<: *common-anubis
|
|
environment:
|
|
<<: *common-anubis-env
|
|
TARGET: "http://invidious5:3000"
|
|
COOKIE: "anubis.inv5"
|
|
networks: ["invidious5"]
|
|
ports:
|
|
- 127.0.0.1:9055:9090
|
|
|
|
# HAPROXY SECTION #
|
|
haproxy:
|
|
<<: *common-haproxy
|
|
ports:
|
|
- "127.0.0.1:11101:8001"
|
|
- "127.0.0.1:11102:8002"
|
|
- "127.0.0.1:11103:8003"
|
|
- "127.0.0.1:11104:8004"
|
|
- "127.0.0.1:11105:8005"
|
|
- "127.0.0.1:11111:8404"
|
|
networks: ["invidious", "invidious2", "invidious3", "invidious4", "invidious5"]
|
|
|
|
# Pgbouncer to keep connections to the database open
|
|
pgbouncer:
|
|
image: edoburu/pgbouncer
|
|
restart: unless-stopped
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- POOL_MODE=transaction
|
|
# Everything is being done locally
|
|
# https://www.pgbouncer.org/config.html
|
|
- 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
|