# Docker compose file for inv.nadeko.net

services:
  valkey:
    image: valkey/valkey:7.2-alpine
    restart: unless-stopped
    volumes:
      - "./valkey:/data"

  invidious-refresher:
    image: git.nadeko.net/fijxu/invidious:latest
    restart: unless-stopped
    volumes:
      - ./config/config-refresher.yml:/etc/invidious/config.yml:ro
      - ./logs:/var/log/invidious:rw
      - /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw
    environment:
      INVIDIOUS_CONFIG_FILE: /etc/invidious/config.yml
    depends_on:
      - valkey
    healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/trending || exit 1
      interval: 30s
      timeout: 5s
      retries: 2


  invidious:
    image: git.nadeko.net/fijxu/invidious:latest
    restart: unless-stopped
    deploy:
      replicas: 8
    volumes:
      - ./config/config.yml:/etc/invidious/config.yml:ro
      - ./logs:/var/log/invidious:rw
      - /var/run/postgresql/.s.PGSQL.5432:/var/run/postgresql/.s.PGSQL.5432:rw
    environment:
      INVIDIOUS_CONFIG_FILE: /etc/invidious/config.yml
    depends_on:
      - valkey
    healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/trending || exit 1
      interval: 30s
      timeout: 5s
      retries: 2


  invidious-nginx:
    image: nginx:latest
    restart: unless-stopped
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    depends_on:
      - invidious
    ports:
      - "127.0.0.1:10011:3000"
