# ============================================================================ # Shrinkerr — local development compose # # This file builds the image from the Dockerfile in this directory. Use it # when you're hacking on Shrinkerr itself. For production / Portainer deploys # where you want to pull a prebuilt image instead, see `docker-compose.portainer.yml`. # # Quick start: # 1. Edit the two `volumes:` paths below so they point to your real data. # 2. Run: docker compose up -d --build # 3. Open: http://localhost:6680 # # First-run account: there isn't one — Shrinkerr has no auth by default. If # you expose it beyond localhost, set an API key in Settings → System. # ============================================================================ services: shrinkerr: # Build the portable (CPU-only, multi-arch) image from `Dockerfile`. # For the GPU/NVENC image, use `Dockerfile.nvenc`: # build: # context: . # dockerfile: Dockerfile.nvenc # # To skip the build and pull a prebuilt image instead, comment `build:` # out and uncomment one of these `image:` lines: # Portable (works on ANY host — Mac, Windows, Linux, Pi, ARM…): # shrinkerr:latest — ffmpeg n7.1 (default, stable) # shrinkerr:edge — ffmpeg master (bleeding edge) # NVENC (x86_64 Linux host with NVIDIA GPU + Container Toolkit): # shrinkerr:nvenc — ffmpeg n7.1 (NVIDIA driver 525.60.13+) # shrinkerr:edge-nvenc — ffmpeg master (NVIDIA driver 570.00+) # Or build every tag at once with: ./scripts/build-images.sh build: . # image: shrinkerr:latest # image: shrinkerr:edge # image: shrinkerr:nvenc # image: shrinkerr:edge-nvenc container_name: shrinkerr # Web UI + API. Change the LEFT side if 6680 is taken on your host. # "8080:6680" → visit http://localhost:8080 # Don't change the right side (that's the port inside the container). ports: - "6680:6680" volumes: # --- Required: database + app data --- # Holds the SQLite DB, logs, backups, and the encoding history. # If you delete this folder, you lose all settings and history. # Linux/Mac: use a relative path (./data) or an absolute one # Windows: use C:\path\to\data:/app/data - ./data:/app/data # --- Required: your media library --- # Point this at the folder containing your Movies/TV/etc. Shrinkerr # will scan it and write converted files back to the same location # (with the originals trashed or permanently deleted depending on your # Settings → Automation config). # Shrinkerr needs READ + WRITE access — it overwrites originals in place. # Examples: # Linux/Mac: - /srv/media:/media # - /mnt/nas/media:/media # Windows: - E:\media:/media - /srv/media:/media # --- Optional: NZBGet / SABnzbd download folders --- # If you use the NZBGet / SABnzbd post-processing scripts, mount the # "completed downloads" folders here so Shrinkerr can see the files # the downloader just dropped. Skip these if you don't use nzb/sab. # - /srv/downloads/completed/TV:/downloads/tv # - /srv/downloads/completed/Movies:/downloads/movies # No `environment:` block needed — the app's defaults for DB path # (/app/data/shrinkerr.db) and media root (/media) already match the # volume mounts above. Override with SHRINKERR_DB_PATH or # SHRINKERR_MEDIA_ROOT by adding an `environment:` block here if # you need to point elsewhere. restart: unless-stopped # ======================================================================= # GPU passthrough — ONLY needed if you're using the :nvenc / :edge-nvenc # image (or building from Dockerfile.nvenc). The portable image has no # CUDA runtime, so this block does nothing for it. # # To enable NVENC: # 1. Change the `image:` line above to :nvenc / :edge-nvenc. # 2. Add `- NVIDIA_VISIBLE_DEVICES=all` under `environment:` above. # 3. Uncomment the GPU block below. Two scenarios: # Linux (with NVIDIA Container Toolkit): # uncomment BOTH `runtime: nvidia` AND `deploy:` # Windows (Docker Desktop in WSL2 mode): # uncomment ONLY `deploy:` — Docker Desktop does not register # a `nvidia` runtime name and will reject the `runtime:` line. # macOS: not supported — use the portable :latest image. # # Why both on Linux? `deploy:` is the portable-spec way and should work # on its own with a modern Docker + Compose V2. In practice on many # installs (especially where the toolkit is installed but `nvidia` isn't # set as the default runtime) `deploy:` alone silently fails to pass the # GPU through. `runtime: nvidia` is the reliable explicit request. # # DRIVER VERSION: :nvenc → driver 525.60.13+; :edge-nvenc → driver 570+. # The Monitor page shows your driver version and flags any mismatch. # ======================================================================= # runtime: nvidia # deploy: # resources: # reservations: # devices: # - driver: nvidia # count: all # capabilities: [gpu, video] # ========================================================================== # Optional: remote worker node # # Uncomment this block to run a second container that picks up jobs from # the main server above. Useful if you have a beefier machine sitting idle # on the network (e.g. a gaming PC) that you want to use for CPU encoding. # # Steps: # 1. In the main server UI: Settings → Nodes → create a worker API key. # 2. Copy that key into API_KEY below. # 3. Set SERVER_URL to the main container's address from the worker's POV. # 4. `docker compose up -d shrinkerr-worker` # 5. The node will appear on the Monitor page within ~30 seconds. # ========================================================================== # shrinkerr-worker: # build: . # container_name: shrinkerr-worker # environment: # - SHRINKERR_MODE=worker # switches the container to worker mode # - SERVER_URL=http://shrinkerr:6680 # or http://:6680 if on a different host # - API_KEY=REPLACE_WITH_WORKER_KEY # create in Settings → Nodes # - WORKER_NAME=beefy-desktop # shows up in the Nodes page # - CAPABILITIES=nvenc,libx265 # or just "libx265" on CPU-only boxes # # If the worker sees the media at a different path than the server does, # # set PATH_MAPPINGS as a JSON list of [server_path, worker_path] pairs. # # Example: server sees /media/Movies, worker sees /mnt/nas/Movies: # # - PATH_MAPPINGS=[["/media","/mnt/nas"]] # - NVIDIA_VISIBLE_DEVICES=all # volumes: # - /srv/media:/media # must match what the server sees (or use PATH_MAPPINGS) # restart: unless-stopped # deploy: # resources: # reservations: # devices: # - driver: nvidia # count: all # capabilities: [gpu, video]