services: plex: # Pin the tag. The migrated database is from PMS 1.43.3.10828 and SQLite # schema upgrades are ONE-WAY — the server here must be equal or newer, and # you do not want a surprise release performing an unexpected schema # migration on build night. Set this to a concrete tag before first start. image: lscr.io/linuxserver/plex:latest container_name: plex restart: unless-stopped # NOT OPTIONAL. Plex's local discovery (GDM) and client auto-detection rely # on broadcast traffic that a bridge network silently eats. (DLNA is off on # this server, so discovery — not DLNA — is the reason.) This is also why # Plex does not sit behind NPM like everything else here: proxy host 17 # already points plex.thewichersfamily.com at 10.0.1.20:32400 and needs no # change, because the IP does not move. network_mode: host environment: - PUID=3000 # MUST equal uid= on the CIFS mounts - PGID=3000 # MUST equal gid= on the CIFS mounts - TZ=${TZ:-America/New_York} - VERSION=docker # No PLEX_CLAIM. The migration carries MachineIdentifier, # ProcessedMachineIdentifier and the online token across in # Preferences.xml, so this server IS the existing server — already # claimed, shared users intact, clients not needing to re-add it. # Claiming would create a NEW server identity and throw that away. devices: # Quick Sync on the UHD 630. No session cap and better HDR tone mapping # than the Pascal-era NVENC on the 1070. - /dev/dri:/dev/dri group_add: # Render node is root:render and PGID 3000 is not in that group. # Resolved from the live host by 50-plex.sh — the gid differs across # distro releases, so do not hardcode it. - "${RENDER_GID:-993}" volumes: # ---- Plex data directory ------------------------------------------- # Whole directory on the SSD: database, Metadata/ (25 GB of posters) and # Media/ (337 GB of migrated preview cache). ~364 GB in ~440 GB usable. # Fully supported layout — no split, no bind-mount trickery. - type: bind source: /srv/plex/config target: /config # ---- PHASE 2 (post-soak, optional) ---------------------------------- # Relocate the 337 GB preview cache to the 3 TB ext4 disk so future # thumbnail growth (~28 MB per content-hour) stops consuming the SSD. # Long-form syntax deliberately: the target path contains spaces, which # the short "a:b" form handles badly. Docker orders mounts by target # depth, so this correctly lands inside the /config mount above. # # Plex does NOT support relocating this directory. Enable it only after # running scripts/60-media-relocate.sh, which performs the move and then # forces thumbnail generation on a single title to prove that writes # succeed across the filesystem boundary. Rollback is moving it back. # # - type: bind # source: /srv/data/plex-media # target: /config/Library/Application Support/Plex Media Server/Media # ---- NAS media, mounted at the SAME paths the database stores ------- # The remap rewrites \\korval\X -> /mnt/nas/X, so the container must see # exactly /mnt/nas/X. Six separate entries rather than one bind of # /mnt/nas, because a plain bind does not carry the submounts beneath it. # Read-only: Plex has no reason to write to the library, and the NAS # account is read-write. - type: bind source: /mnt/nas/media target: /mnt/nas/media read_only: true - type: bind source: /mnt/nas/Radio Shows target: /mnt/nas/Radio Shows read_only: true - type: bind source: /mnt/nas/Education Videos target: /mnt/nas/Education Videos read_only: true - type: bind source: /mnt/nas/Health target: /mnt/nas/Health read_only: true - type: bind source: /mnt/nas/Home Movies target: /mnt/nas/Home Movies read_only: true - type: bind source: /mnt/nas/Pictures target: /mnt/nas/Pictures read_only: true tmpfs: # Matches TranscoderTempDirectory=/transcode in the generated # Preferences.xml. Transcodes are throwaway; keeping them in RAM saves # a great deal of SSD write wear. 4G of 16G, capped so a pathological # transcode cannot pressure the rest of the system. - /transcode:rw,size=4g,mode=1777