Skip to content

Volumes

Suresh S edited this page Dec 11, 2024 · 2 revisions

Plex/Jellyfin/Emby Volume Configuration Guide

When creating symlinks for media directories, it is essential to use absolute paths within your Docker containers to ensure proper functionality.

Example Docker Compose Configuration

Below is an example configuration for a Jellyfin container:

services:
  jellyfin:
    image: jellyfin/jellyfin
    container_name: jellyfin
    network_mode: 'host'
    volumes:
      - .config:/config
      - .cache:/cache
      - type: bind
        source: /mnt
        target: /media1
      - type: bind
        source: /home/zurg
        target: /zurg
      - type: bind
        source: /mnt/CineSync
        target: /media
    restart: 'unless-stopped'
    environment:
      - JELLYFIN_PublishedServerUrl=http://localhost:8096
      - PUID=0
      - PGID=0

Understanding Volume Mounts

If your zurg or actual debrid mount is located at /home/zurg, and your CineSync symlinks are located under /mnt/CineSync, the volumes will be mapped as follows:

Inside Your Container

  • /home/zurg maps to /zurg
  • /mnt/CineSync maps to /media

Example Paths

In your local setup:

  • /home/zurg/Movies/Eternal Sunshine of the Spotless Mind
  • /mnt/CineSync/Movies/Eternal Sunshine of the Spotless Mind (Symlinked file pointing to /home/zurg/Movies/Eternal Sunshine of the Spotless Mind)

Inside the Jellyfin container:

  • /home/zurg/Movies/Eternal Sunshine of the Spotless Mind becomes /zurg/Movies/Eternal Sunshine of the Spotless Mind
  • /mnt/CineSync/Movies/Eternal Sunshine of the Spotless Mind becomes /media/CineSync/Movies/Eternal Sunshine of the Spotless Mind

The Issue with Symlinks

Symlinks require absolute paths. This can cause mismatches and media inaccessibility if paths inside the container do not align with the symlinks' original absolute paths. For example:

  • /home/zurg/Movies/Eternal Sunshine of the Spotless Mind/zurg/Movies/Eternal Sunshine of the Spotless Mind
  • /mnt/CineSync/Movies/Eternal Sunshine of the Spotless Mind/media/CineSync/Movies/Eternal Sunshine of the Spotless Mind

The path /media will no longer points to /mnt since we did not map that inside the container. This mismatch can lead to media breakage.

Solution: Mount Full Directories

To avoid these issues, mount the full directories instead of specific folders. Update your volumes section as follows:

volumes:
  - type: bind
    source: /mnt
    target: /mnt
  - type: bind
    source: /home
    target: /home

By mounting the entire /mnt and /home directories, all symlinks and paths will remain consistent and accessible inside the container.

Next Steps

  1. Learn about usage