scrypted/templates/docker-compose.yml.j2
author Luke Hoersten <luke@hoersten.org>
Mon, 07 Oct 2024 23:31:51 -0500
changeset 239 c3e3169399a8
parent 235 f88bb54f63bd
permissions -rw-r--r--
Updated java version and disabled geyser due to too old jde.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
235
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     1
# The Scrypted docker-compose.yml file typically resides at:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     2
# ~/.scrypted/docker-compose.yml
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     3
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     4
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     5
# Scrypted NVR Storage (Optional Network Volume: Part 1 of 3)
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     6
# Example volumes SMB (CIFS) and NFS.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     7
# Uncomment only one.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     8
# volumes:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
     9
#     nvr:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    10
#         driver_opts:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    11
#             type: cifs
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    12
#             o: username=[username],password=[password],vers=3.0,file_mode=0777,dir_mode=0777
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    13
#             device: //[ip-address]/[path-to-directory]
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    14
#     nvr:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    15
#         driver_opts:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    16
#             type: "nfs"
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    17
#             o: "addr=[ip-address],nolock,soft,rw"
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    18
#             device: ":[path-to-directory]"
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    19
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    20
services:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    21
    scrypted:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    22
        environment:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    23
            # Scrypted NVR Storage (Part 2 of 3)
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    24
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    25
            # Uncomment the next line to configure the NVR plugin to store recordings
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    26
            # use the /nvr directory within the container. This can also be configured
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    27
            # within the plugin manually.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    28
            # The drive or network share will ALSO need to be configured in the volumes
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    29
            # section below.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    30
            # - SCRYPTED_NVR_VOLUME=/nvr
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    31
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    32
            - SCRYPTED_WEBHOOK_UPDATE_AUTHORIZATION=Bearer {{scrypted_auth_key}}
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    33
            - SCRYPTED_WEBHOOK_UPDATE=http://localhost:{{scrypted_auto_update_port}}/v1/update
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    34
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    35
            # Avahi can be used for network discovery by passing in the host daemon
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    36
            # or running the daemon inside the container. Choose one or the other.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    37
            # Uncomment next line to run avahi-daemon inside the container.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    38
            # See volumes and security_opt section below to use the host daemon.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    39
            # - SCRYPTED_DOCKER_AVAHI=true
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    40
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    41
            # NVIDIA (Part 1 of 4)
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    42
            # - NVIDIA_VISIBLE_DEVICES=all
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    43
            # - NVIDIA_DRIVER_CAPABILITIES=all
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    44
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    45
        # NVIDIA (Part 2 of 4)
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    46
        # runtime: nvidia
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    47
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    48
        # NVIDIA (Part 3 of 4) - Use NVIDIA image, and remove subsequent default image.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    49
        # image: ghcr.io/koush/scrypted:nvidia
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    50
        image: ghcr.io/koush/scrypted
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    51
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    52
        volumes:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    53
            # NVIDIA (Part 4 of 4)
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    54
            # - /etc/OpenCL/vendors/nvidia.icd:/etc/OpenCL/vendors/nvidia.icd
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    55
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    56
            # Scrypted NVR Storage (Part 3 of 3)
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    57
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    58
            # Modify to add the additional volume for Scrypted NVR.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    59
            # The following example would mount the /mnt/sda/video path on the host
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    60
            # to the /nvr path inside the docker container.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    61
            # - /mnt/media/video:/nvr
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    62
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    63
            # Or use a network mount from one of the CIFS/NFS examples at the top of this file.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    64
            # - type: volume
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    65
            #   source: nvr
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    66
            #   target: /nvr
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    67
            #   volume:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    68
            #     nocopy: true
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    69
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    70
            # Uncomment the following lines to use Avahi daemon from the host.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    71
            # Ensure Avahi is running on the host machine:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    72
            # It can be installed with: sudo apt-get install avahi-daemon
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    73
            # This is not compatible with running avahi inside the container (see above).
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    74
            # Also, uncomment the lines under security_opt
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    75
            - /var/run/dbus:/var/run/dbus
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    76
            - /var/run/avahi-daemon/socket:/var/run/avahi-daemon/socket
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    77
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    78
            # Default volume for the Scrypted database. Typically should not be changed.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    79
            - {{scrypted_dir}}/volume:/server/volume
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    80
        # Uncomment the following lines to use Avahi daemon from the host
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    81
        # Without this, AppArmor will block the container's attempt to talk to Avahi via dbus
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    82
        security_opt:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    83
            - apparmor:unconfined
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    84
        devices: [
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    85
            # uncomment the common systems devices to pass
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    86
            # them through to docker.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    87
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    88
            # all usb devices, such as coral tpu
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    89
            # "/dev/bus/usb:/dev/bus/usb",
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    90
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    91
            # hardware accelerated video decoding, opencl, etc.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    92
            # "/dev/dri:/dev/dri",
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    93
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    94
            # uncomment below as necessary.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    95
            # zwave usb serial device
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    96
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    97
            # "/dev/ttyACM0:/dev/ttyACM0",
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    98
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
    99
            # coral PCI devices
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   100
            # "/dev/apex_0:/dev/apex_0",
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   101
            # "/dev/apex_1:/dev/apex_1",
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   102
        ]
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   103
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   104
        container_name: scrypted
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   105
        restart: unless-stopped
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   106
        network_mode: host
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   107
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   108
        # logging is noisy and will unnecessarily wear on flash storage.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   109
        # scrypted has per device in memory logging that is preferred.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   110
        # enable the log file if enhanced debugging is necessary.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   111
        logging:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   112
            driver: "none"
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   113
            # driver: "json-file"
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   114
            # options:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   115
            #     max-size: "10m"
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   116
            #     max-file: "10"
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   117
        labels:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   118
            - "com.centurylinklabs.watchtower.scope=scrypted"
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   119
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   120
    # watchtower manages updates for Scrypted.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   121
    watchtower:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   122
        environment:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   123
            - WATCHTOWER_HTTP_API_TOKEN={{scrypted_auth_key}}
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   124
            - WATCHTOWER_HTTP_API_UPDATE=true
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   125
            - WATCHTOWER_SCOPE=scrypted
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   126
            # remove the following line to never allow docker to auto update.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   127
            # this is not recommended.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   128
            - WATCHTOWER_HTTP_API_PERIODIC_POLLS=true
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   129
        image: containrrr/watchtower
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   130
        container_name: scrypted-watchtower
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   131
        restart: unless-stopped
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   132
        volumes:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   133
            - /var/run/docker.sock:/var/run/docker.sock
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   134
        labels:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   135
            - "com.centurylinklabs.watchtower.scope=scrypted"
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   136
        ports:
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   137
            # The auto update port 10444 can be configured
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   138
            # Must match the port in the auto update url above.
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   139
            - {{scrypted_auto_update_port}}:8080
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   140
        # check for updates once an hour (interval is in seconds)
f88bb54f63bd Added scrypted role.
Luke Hoersten <luke@hoersten.org>
parents:
diff changeset
   141
        command: --interval 3600 --cleanup --scope scrypted