diff --git a/invidious/invidious-all/docker-compose.yml b/invidious/invidious-all/docker-compose.yml index 4aa78c0..f2349cc 100644 --- a/invidious/invidious-all/docker-compose.yml +++ b/invidious/invidious-all/docker-compose.yml @@ -1,13 +1,16 @@ -# Docker compose file for Backend 1 of inv.nadeko.net - -# https://docs.docker.com/reference/compose-file/extension/ +# 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 @@ -21,10 +24,14 @@ x-common: &common deploy: replicas: 3 volumes: - - /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw + # 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 @@ -43,7 +50,7 @@ services: <<: *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"] + depends_on: ["valkey", "haproxy"] invidious2: <<: *common @@ -51,7 +58,7 @@ services: <<: *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"] + depends_on: ["valkey2", "haproxy2"] invidious3: <<: *common @@ -59,7 +66,7 @@ services: <<: *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"] + depends_on: ["valkey3", "haproxy3"] invidious4: <<: *common @@ -67,7 +74,15 @@ services: <<: *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"] + 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 # @@ -99,6 +114,27 @@ services: - "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 @@ -108,3 +144,5 @@ networks: name: invidious3 invidious4: name: invidious4 + invidious5: + name: invidious5