wiki/docs/docker-compose/invidious.md
2024-05-04 17:03:07 +02:00

1.7 KiB

Portainer Stack:


---
version: "3.9"
services:

  invidious:
    image: quay.io/invidious/invidious:${TAG-latest}
    container_name: invidious
    restart: ${RST-unless-stopped}
    network_mode: ${NET_MODE-bridge}
    ports:
      - ${PORT_INVIDIOUS}:3000
    environment:
      INVIDIOUS_CONFIG: |
        db:
          dbname: ${DB_NAME-invidious}
          user: ${DB_USER-kemal}
          password: ${DB_PWD-kemal}
          host: invidious-db
          port: 5432
        check_tables: true
        force_resolve: ipv4
        dark_mode: false
        statistics_enabled: true
        registration_enabled: false
        captcha_enabled: false
        admins: ["sthope"]
        default_user_preferences:
          locale: en-US
          region: PT
    healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/comments/jNQXAC9IVRw || exit 1
      interval: 30s
      timeout: 5s
      retries: 2
    depends_on:
      - invidious-db

  invidious-db:
    image: docker.io/library/postgres:${TAG-latest}
    container_name: invidious-db
    restart: ${RST-unless-stopped}
    network_mode: ${NET_MODE-bridge}
    volumes:
      - ${VOLUME_DB_DATA}:/var/lib/postgresql/data
      - ${VOLUME_DB_SQL}:/config/sql
      - ${VOLUME_DB_SCRIPT}:/docker-entrypoint-initdb.d/init-invidious-db.sh
    environment:
      POSTGRES_DB: ${DB_NAME-invidious}
      POSTGRES_USER: ${DB_USER-kemal}
      POSTGRES_PASSWORD: ${DB_PWD-kemal}
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]

Environments:

TAG=latest
RST=unless-stopped
PORT_INVIDIOUS=
VOLUME_DB_DATA=
VOLUME_DB_SQL=
VOLUME_DB_SCRIPT=
DB_NAME=invidious
DB_USER=kemal
DB_PWD=kemal