Use docker compose fragments instead of extend to prevent attribute duplication

This commit is contained in:
root 2024-11-12 09:53:31 -03:00
parent a9755211a4
commit 07d855ac35
2 changed files with 74 additions and 69 deletions

View file

@ -1,54 +1,56 @@
# Docker compose file for Backend 3 of inv.nadeko.net # 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 CLEARNET
invidious: invidious:
extends: <<: *common-config
service: invidious-extend
environment: environment:
<<: *env
INVIDIOUS_PORT: "3000" INVIDIOUS_PORT: "3000"
invidious2: invidious2:
extends: <<: *common-config
service: invidious-extend
environment: environment:
<<: *env
INVIDIOUS_PORT: "3001" INVIDIOUS_PORT: "3001"
invidious3: invidious3:
extends: <<: *common-config
service: invidious-extend
environment: environment:
<<: *env
INVIDIOUS_PORT: "3002" INVIDIOUS_PORT: "3002"
invidious4: invidious4:
extends: <<: *common-config
service: invidious-extend environment:
<<: *env
INVIDIOUS_PORT: "3003" INVIDIOUS_PORT: "3003"
# SIGNATURE HELPER # SIGNATURE HELPER

View file

@ -1,54 +1,56 @@
# Docker compose file for Backend 2 of inv.nadeko.net # Docker compose file for Backend 2 of inv.nadeko.net
services: #https://docs.docker.com/reference/compose-file/fragments/
invidious-extend: x-common-config: &common-config
env_file: env_file:
# Env file containing variables like TAG, INV_MEM_* # Env file containing variables like TAG, INV_MEM_*
- .env - .env
# Env file containing INVIDIOUS_* variables # Env file containing INVIDIOUS_* variables
- ../.env - ../.env
image: "git.nadeko.net/fijxu/invidious:${TAG}" image: "git.nadeko.net/fijxu/invidious:${TAG}"
restart: unless-stopped restart: unless-stopped
mem_limit: ${INV_MEM_LIMIT} mem_limit: ${INV_MEM_LIMIT}
mem_reservation: ${INV_MEM_RESERVATION} mem_reservation: ${INV_MEM_RESERVATION}
cpus: ${INV_CPU} # Limit to X% of the CPU cpus: ${INV_CPU} # Limit to X% of the CPU
network_mode: "service:gluetun" network_mode: "service:gluetun"
volumes: volumes:
- /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw - /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw
- ./config.yml:/etc/invidious/config.yml:ro - ./config.yml:/etc/invidious/config.yml:ro
depends_on: depends_on:
# - inv_sig_helper # - inv_sig_helper
- haproxy - haproxy
environment: environment: &env
INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml" INVIDIOUS_CONFIG_FILE: "/etc/invidious/config.yml"
healthcheck: healthcheck:
test: wget -nv --tries=1 --spider https://inv.nadeko.net/watch?v=mcYLzu_1cNc || exit 1 test: wget -nv --tries=1 --spider https://inv.nadeko.net/watch?v=mcYLzu_1cNc || exit 1
interval: 300s interval: 300s
timeout: 5s timeout: 5s
retries: 2 retries: 2
services:
# INVIDIOUS CLEARNET # INVIDIOUS CLEARNET
invidious: invidious:
extends: <<: *common-config
service: invidious-extend
environment: environment:
<<: *env
INVIDIOUS_PORT: "3000" INVIDIOUS_PORT: "3000"
invidious2: invidious2:
extends: <<: *common-config
service: invidious-extend
environment: environment:
<<: *env
INVIDIOUS_PORT: "3001" INVIDIOUS_PORT: "3001"
invidious3: invidious3:
extends: <<: *common-config
service: invidious-extend
environment: environment:
<<: *env
INVIDIOUS_PORT: "3002" INVIDIOUS_PORT: "3002"
invidious4: invidious4:
extends: <<: *common-config
service: invidious-extend environment:
<<: *env
INVIDIOUS_PORT: "3003" INVIDIOUS_PORT: "3003"
# SIGNATURE HELPER # SIGNATURE HELPER
@ -130,3 +132,4 @@ networks:
gluetun_network: gluetun_network:
external: true external: true