summaryrefslogtreecommitdiff
path: root/invidious/docker-compose.yml
blob: c261a389a7706695f6a42b4d3807b79bf8935e65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
services:
  invidious:
    image: quay.io/invidious/invidious:latest
    restart: unless-stopped
    # Remove "127.0.0.1:" if used from an external IP
    ports:
      - "3000:3000"
    environment:
      # Please read the following file for a comprehensive list of all available
      # configuration options and their associated syntax:
      # https://github.com/iv-org/invidious/blob/master/config/config.example.yml
      INVIDIOUS_CONFIG: |
        db:
          dbname: invidious
          user: kemal
          password: ${POSTGRES_PASSWORD:-kemal}
          host: invidious-db
          port: 5432
        check_tables: true
        invidious_companion:
        - private_url: "http://companion:8282/companion"
        # Use the key generated in the 2nd step
        invidious_companion_key: "${INVIDIOUS_COMPANION_KEY}"
        # Use the key generated in the 1st step
        hmac_key: "${INVIDIOUS_HMAC_KEY}"
    healthcheck:
      test: wget -nv --tries=1 --spider http://127.0.0.1:3000/api/v1/stats || exit 1
      interval: 30s
      timeout: 5s
      retries: 2
    logging:
      options:
        max-size: "1G"
        max-file: "4"
    depends_on:
      - invidious-db

  companion:
    image: quay.io/invidious/invidious-companion:latest
    # Please read the following file for a comprehensive list of all available
    # environment variables and their associated syntax:
    # https://github.com/iv-org/invidious/blob/master/config/config.example.yml
    environment:
    # Use the key generated in the 2nd step
       - SERVER_SECRET_KEY=${INVIDIOUS_COMPANION_KEY}
    restart: unless-stopped
    # Uncomment only if you have configured "public_url" for Invidious companion
    # Or if you want to use Invidious companion as an API in your program.
    # Remove "127.0.0.1:" if used from an external IP
    #ports:
    #  - "127.0.0.1:8282:8282"
    logging:
      options:
        max-size: "1G"
        max-file: "4"
    cap_drop:
      - ALL
    read_only: true
    # cache for youtube library
    volumes:
      - companioncache:/var/tmp/youtubei.js:rw
    security_opt:
      - no-new-privileges:true

  invidious-db:
    image: docker.io/library/postgres:14
    restart: unless-stopped
    volumes:
      - postgresdata:/var/lib/postgresql/data
      - ./config/sql:/config/sql
      - ./docker/init-invidious-db.sh:/docker-entrypoint-initdb.d/init-invidious-db.sh
    environment:
      POSTGRES_DB: invidious
      POSTGRES_USER: kemal
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-kemal}
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]

volumes:
  postgresdata:
  companioncache: