Synology Docker Install of CDVR

So my lack of Linux and Docker will shine through in this post but hoping folks pointing me in the right direction I'll get this working as well as learn something new.

I'm looking to install a DVR server in Docker for testing purposes and perhaps a backend source for my DVR server that is installed through the Package Center.

Since both are on the same machine, I need to change the port for the test/backend server and have been trying to the below via Portainer:

version: '3.9'
services:
  # 2024.09.15
  # Docker Hub home for this project: https://hub.docker.com/r/fancybits/channels-dvr
  channels-dvr:
    image: fancybits/channels-dvr:tve
    container_name: channels-dvr
    devices:
      - /dev/dri:/dev/dri
    ports:
      - 8088:8089
    environment:
      - CHANNELS_PORT=8089
      - TZ=America/New_York
    volumes:
      - /volume1/docker/channels-dvr:/channels-dvr
      - /mnt/dvr:/shares/dvr
    #network_mode: host
    restart: unless-stopped
#volumes: # use this section if you've setup a docker volume named channels-dvr, with CIFS or NFS, to bind to /channels-dvr inside the container
  #channels-dvr:
    #external: ${VOL_EXTERNAL}
    #name: ${VOL_NAME}

It shows the image created but is not installing the container. I get a warniing about the "version" but also says it's ignoring that. But when I try and leave the stacks page to go look at the container and images sections, it gives me a warning stating that I have unsavd changes in the editor (even though I ran the stack). I'm assuming the above is downloading the image but failing to build the container and as such, the Stack hasn't completed and been saved?

I created a channels-dvr in file station under /volume1/docker/. I am uncertain about /mnt/dvr however. I would think the /mnt/dvr is outside of the docker folder structure?

Any pointers on what I am doing wrong?

Thanks.

Using a docker container install on a Synology you need to use host network mode.
And then change the port Channels DVR uses by setting the env var CHANNELS_PORT.
Your recording directory volume should be a shared folder you created in volume1.
In my example below, it's /volume1/chDVRsynotest

Here's a compose for one of my servers

version: '3.9'
services:
  # Docker container home: https://hub.docker.com/r/fancybits/channels-dvr
  # image uses host mode networking and port is specified by env variable CHANNELS_PORT
  channels-dvr:
    image: fancybits/channels-dvr:tve                     # use :tve tag, not :latest
    container_name: channels-dvr
    network_mode: "host"                                  # must run in host, not bridge mode
    devices:
      - "/dev/dri:/dev/dri"                               # to enable hardware transcoding
    environment:
      - CHANNELS_PORT=8190                                # MODIFY the host port number to use
      - TZ=America/Los_Angeles                            # MODIFY your local timezone in standard linux format
    volumes:
      - "/volume1/docker/channels-dvr:/channels-dvr"      # Channels DVR executables and log directory
      - "/volume1/chDVRsynotest:/volume1/chDVRsynotest"   # MODIFY Channels DVR recording directory
    # Add volumes for local content import directories
    restart: unless-stopped

I have 6 Channels DVR Servers running in containers on my Synology NAS.
I was naming the directories for the main source it was hosting, but then started moving the sources around.
In hindsight, I should have set them up like this, so I know which port each is running on.

Server 1 on port 8189

version: '3.9'
services:
  # Docker container home: https://hub.docker.com/r/fancybits/channels-dvr
  # image uses host mode networking and port is specified by env variable CHANNELS_PORT
  channels-dvr-8189:
    image: fancybits/channels-dvr:tve                     # use :tve tag, not :latest
    container_name: channels-dvr-8189
    network_mode: "host"                                  # must run in host, not bridge mode
    devices:
      - "/dev/dri:/dev/dri"                               # to enable hardware transcoding
    environment:
      - CHANNELS_PORT=8189                                # MODIFY the host port number to use
      - TZ=America/Los_Angeles                            # MODIFY your local timezone in standard linux format
    volumes:
      - "/volume1/docker/channels-dvr-8189:/channels-dvr" # Channels DVR executables and log directory
      - "/volume1/ChDVR8189:/volume1/ChDVR8189"           # MODIFY Channels DVR recording directory
    # Add volumes for local content import directories
    restart: unless-stopped

Server 2 on port 8289

version: '3.9'
services:
  # Docker container home: https://hub.docker.com/r/fancybits/channels-dvr
  # image uses host mode networking and port is specified by env variable CHANNELS_PORT
  channels-dvr-8289:
    image: fancybits/channels-dvr:tve                     # use :tve tag, not :latest
    container_name: channels-dvr-8289
    network_mode: "host"                                  # must run in host, not bridge mode
    devices:
      - "/dev/dri:/dev/dri"                               # to enable hardware transcoding
    environment:
      - CHANNELS_PORT=8289                                # MODIFY the host port number to use
      - TZ=America/Los_Angeles                            # MODIFY your local timezone in standard linux format
    volumes:
      - "/volume1/docker/channels-dvr-8289:/channels-dvr" # Channels DVR executables and log directory
      - "/volume1/ChDVR8289:/volume1/ChDVR8289"           # MODIFY Channels DVR recording directory
    # Add volumes for local content import directories
    restart: unless-stopped

Server 3 on port 8389

version: '3.9'
services:
  # Docker container home: https://hub.docker.com/r/fancybits/channels-dvr
  # image uses host mode networking and port is specified by env variable CHANNELS_PORT
  channels-dvr-8389:
    image: fancybits/channels-dvr:tve                     # use :tve tag, not :latest
    container_name: channels-dvr-8389
    network_mode: "host"                                  # must run in host, not bridge mode
    devices:
      - "/dev/dri:/dev/dri"                               # to enable hardware transcoding
    environment:
      - CHANNELS_PORT=8389                                # MODIFY the host port number to use
      - TZ=America/Los_Angeles                            # MODIFY your local timezone in standard linux format
    volumes:
      - "/volume1/docker/channels-dvr-8389:/channels-dvr" # Channels DVR executables and log directory
      - "/volume1/ChDVR8389:/volume1/ChDVR8389"           # MODIFY Channels DVR recording directory
    # Add volumes for local content import directories
    restart: unless-stopped

Server 4 on port 8489

version: '3.9'
services:
  # Docker container home: https://hub.docker.com/r/fancybits/channels-dvr
  # image uses host mode networking and port is specified by env variable CHANNELS_PORT
  channels-dvr-8489:
    image: fancybits/channels-dvr:tve                     # use :tve tag, not :latest
    container_name: channels-dvr-8489
    network_mode: "host"                                  # must run in host, not bridge mode
    devices:
      - "/dev/dri:/dev/dri"                               # to enable hardware transcoding
    environment:
      - CHANNELS_PORT=8489                                # MODIFY the host port number to use
      - TZ=America/Los_Angeles                            # MODIFY your local timezone in standard linux format
    volumes:
      - "/volume1/docker/channels-dvr-8489:/channels-dvr" # Channels DVR executables and log directory
      - "/volume1/ChDVR8489:/volume1/ChDVR8489"           # MODIFY Channels DVR recording directory
    # Add volumes for local content import directories
    restart: unless-stopped

Server 5 on port 8589

version: '3.9'
services:
  # Docker container home: https://hub.docker.com/r/fancybits/channels-dvr
  # image uses host mode networking and port is specified by env variable CHANNELS_PORT
  channels-dvr-8589:
    image: fancybits/channels-dvr:tve                     # use :tve tag, not :latest
    container_name: channels-dvr-8589
    network_mode: "host"                                  # must run in host, not bridge mode
    devices:
      - "/dev/dri:/dev/dri"                               # to enable hardware transcoding
    environment:
      - CHANNELS_PORT=8589                                # MODIFY the host port number to use
      - TZ=America/Los_Angeles                            # MODIFY your local timezone in standard linux format
    volumes:
      - "/volume1/docker/channels-dvr-8589:/channels-dvr" # Channels DVR executables and log directory
      - "/volume1/ChDVR8589:/volume1/ChDVR8589"           # MODIFY Channels DVR recording directory
    # Add volumes for local content import directories
    restart: unless-stopped

Server 6 on port 8689

version: '3.9'
services:
  # Docker container home: https://hub.docker.com/r/fancybits/channels-dvr
  # image uses host mode networking and port is specified by env variable CHANNELS_PORT
  channels-dvr-8689:
    image: fancybits/channels-dvr:tve                     # use :tve tag, not :latest
    container_name: channels-dvr-8689
    network_mode: "host"                                  # must run in host, not bridge mode
    devices:
      - "/dev/dri:/dev/dri"                               # to enable hardware transcoding
    environment:
      - CHANNELS_PORT=8689                                # MODIFY the host port number to use
      - TZ=America/Los_Angeles                            # MODIFY your local timezone in standard linux format
    volumes:
      - "/volume1/docker/channels-dvr-8689:/channels-dvr" # Channels DVR executables and log directory
      - "/volume1/ChDVR8689:/volume1/ChDVR8689"           # MODIFY Channels DVR recording directory
    # Add volumes for local content import directories
    restart: unless-stopped
1 Like

The volumes directories to the left of the colon(:) are directories that have to exist on your Synology
The volumes directories to the right of the colon(:) are directories that will be created inside the container if they don't already exist

So; host directory : container directory

- /volume1/docker/channels-dvr:/channels-dvr
/volume1/docker/channels-dvr needs to exist on your Synology and will be used to store executables and the log
/channels-dvr is the directory inside the container that gets mapped to the host directory to the left of the colon(:) /volume1/docker/channels-dvr

- /mnt/dvr:/shares/dvr
/mnt/dvr needs to exist on your Synology and will be used as the recording directory (don't use /mnt/dvr)
/shares/dvr is the directory inside the container that gets mapped to the host directory to the left of the colon(:) /mnt/dvr

1 Like

You'll only see a warning message like that when you also have an actual error. Capture the entire message, so you can deal with the error. Those messages always indicate a failed stack deployment.

3 Likes

LIke your organizing might have to steal the Stacks.

2 Likes

Most likely it was complaining because his host system Synology doesn't have a /mnt/dvr directory.

As you know, when deploying docker containers on a Synology, the docker daemon doesn't create host directories, so the host directory has to be created before deploying the container.

Thanks all. I got it running using port 8088. Setting up the sources now, will report back if something doesn't work as expected.

Congrats :wave:

I would recommend if you're going to use local imports to put them in the DVR Imports/Movies, Imports/TV and Imports/Videos folders, or create symlinks in those folders pointing to your import directories. Makes it easier when running in a docker container and when moving your DVR to another device. That way you won't have to re-import them.