From 07d855ac3572ee2bc066239bac0cef65d4b688a8 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 12 Nov 2024 09:53:31 -0300 Subject: [PATCH] Use docker compose fragments instead of extend to prevent attribute duplication --- invidious/invidious-vpn-2/docker-compose.yml | 72 ++++++++++---------- invidious/invidious-vpn/docker-compose.yml | 71 ++++++++++--------- 2 files changed, 74 insertions(+), 69 deletions(-) diff --git a/invidious/invidious-vpn-2/docker-compose.yml b/invidious/invidious-vpn-2/docker-compose.yml index 2489482..5b04e11 100644 --- a/invidious/invidious-vpn-2/docker-compose.yml +++ b/invidious/invidious-vpn-2/docker-compose.yml @@ -1,54 +1,56 @@ # Docker compose file for Backend 3 of inv.nadeko.net -# -services: - invidious-extend: - env_file: - # Env file containing variables like TAG, INV_MEM_* - - .env - # Env file containing INVIDIOUS_* variables - - ../.env - image: "git.nadeko.net/fijxu/invidious:${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: - # - inv_sig_helper - - haproxy - environment: - INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml" - healthcheck: - test: wget -nv --tries=1 --spider https://inv.nadeko.net/watch?v=mcYLzu_1cNc || exit 1 - interval: 300s - timeout: 5s - retries: 2 +#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:${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: + # - inv_sig_helper + - haproxy + environment: &env + INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml" + healthcheck: + test: wget -nv --tries=1 --spider https://inv.nadeko.net/watch?v=mcYLzu_1cNc || exit 1 + interval: 300s + timeout: 5s + retries: 2 + +services: # INVIDIOUS CLEARNET invidious: - extends: - service: invidious-extend + <<: *common-config environment: + <<: *env INVIDIOUS_PORT: "3000" invidious2: - extends: - service: invidious-extend + <<: *common-config environment: + <<: *env INVIDIOUS_PORT: "3001" invidious3: - extends: - service: invidious-extend + <<: *common-config environment: + <<: *env INVIDIOUS_PORT: "3002" invidious4: - extends: - service: invidious-extend + <<: *common-config + environment: + <<: *env INVIDIOUS_PORT: "3003" # SIGNATURE HELPER diff --git a/invidious/invidious-vpn/docker-compose.yml b/invidious/invidious-vpn/docker-compose.yml index 630ec35..fb764f2 100644 --- a/invidious/invidious-vpn/docker-compose.yml +++ b/invidious/invidious-vpn/docker-compose.yml @@ -1,54 +1,56 @@ # Docker compose file for Backend 2 of inv.nadeko.net -services: - invidious-extend: - env_file: - # Env file containing variables like TAG, INV_MEM_* - - .env - # Env file containing INVIDIOUS_* variables - - ../.env - image: "git.nadeko.net/fijxu/invidious:${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: - # - inv_sig_helper - - haproxy - environment: - INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml" - healthcheck: - test: wget -nv --tries=1 --spider https://inv.nadeko.net/watch?v=mcYLzu_1cNc || exit 1 - interval: 300s - timeout: 5s - retries: 2 +#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:${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: + # - inv_sig_helper + - haproxy + environment: &env + INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml" + healthcheck: + test: wget -nv --tries=1 --spider https://inv.nadeko.net/watch?v=mcYLzu_1cNc || exit 1 + interval: 300s + timeout: 5s + retries: 2 +services: # INVIDIOUS CLEARNET invidious: - extends: - service: invidious-extend + <<: *common-config environment: + <<: *env INVIDIOUS_PORT: "3000" invidious2: - extends: - service: invidious-extend + <<: *common-config environment: + <<: *env INVIDIOUS_PORT: "3001" invidious3: - extends: - service: invidious-extend + <<: *common-config environment: + <<: *env INVIDIOUS_PORT: "3002" invidious4: - extends: - service: invidious-extend + <<: *common-config + environment: + <<: *env INVIDIOUS_PORT: "3003" # SIGNATURE HELPER @@ -130,3 +132,4 @@ networks: gluetun_network: external: true +