docs(docker): add docker-compose.yml for one-command setup
Some checks failed
CI / Test (push) Successful in 2m44s
CI / Build (push) Successful in 1m32s
CI / Build-1 (push) Successful in 1m57s
CI / Build-2 (push) Successful in 1m32s
CI / Build-3 (push) Successful in 1m32s
CI / Build-4 (push) Successful in 1m32s
CI / Build-5 (push) Successful in 1m29s
CI / Lint (push) Failing after 2m24s
CI / Coverage (push) Successful in 2m44s
CI / Vet (push) Successful in 1m59s

Rewrite docker-compose.yml with a user-ready setup:
- pull_policy: always — keeps image up-to-date on every `up`
- network_mode: host — required for LAN/Tailscale streaming reach
- UNARR_API_KEY required variable with clear error message
- DOWNLOAD_DIR required variable
- named `unarr-data` volume for piece-DB + HLS cache (keeps them off NFS)
- macOS/Windows bridge + ports alternative in comments
- .env.example alongside with UNARR_API_KEY, DOWNLOAD_DIR, TZ

Quick start: cp .env.example .env && edit .env && docker compose up -d
This commit is contained in:
Deivid Soto 2026-05-30 09:27:57 +02:00
parent e1fc7b7b6f
commit ea00130d08
2 changed files with 69 additions and 36 deletions

16
.env.example Normal file
View file

@ -0,0 +1,16 @@
# Copy this file to .env and fill in your values.
# Then run: docker compose up -d
# Your TorrentClaw API key (required).
# Get it at: https://torrentclaw.com/settings/api-keys
UNARR_API_KEY=tc_your_key_here
# Absolute path to your media / downloads folder.
# This is where finished movies and shows will be saved.
DOWNLOAD_DIR=/home/youruser/Media
# (Optional) Config directory — defaults to ./config next to this file.
# CONFIG_DIR=/home/youruser/.config/unarr
# (Optional) Timezone for logs.
# TZ=Europe/Madrid

View file

@ -1,48 +1,65 @@
# unarr — TorrentClaw agent
#
# Quick start:
# 1. Copy this file to any directory.
# 2. Set UNARR_API_KEY to your key (Settings → API Keys on torrentclaw.com).
# 3. Set DOWNLOAD_DIR to your media folder (absolute path).
# 4. Run: docker compose up -d
#
# Get your API key: https://torrentclaw.com/settings/api-keys
# Full docs: https://torrentclaw.com/unarr
services: services:
unarr: unarr:
build:
context: ..
dockerfile: unarr/Dockerfile
image: torrentclaw/unarr:latest image: torrentclaw/unarr:latest
pull_policy: always # always pull on `up` so you stay on the latest release
container_name: unarr container_name: unarr
restart: unless-stopped restart: unless-stopped
user: "1000:1000"
# Read-only root filesystem — only volumes are writable # host network is required for:
read_only: true # - streaming to reach your TV / mobile / other LAN devices (port 11818)
tmpfs: # - HLS transcode server (port 11819)
- /tmp:size=64m,mode=1777 # - Tailscale connectivity (if you use it)
# On macOS / Windows Docker Desktop, replace with `ports` mapping (see below).
volumes:
# Config: your config.toml lives here
- ./config:/config
# Downloads: finished media goes here
- ~/Media:/downloads
# Data: torrent metadata, piece DB, cache
- unarr-data:/data
environment:
- TZ=${TZ:-UTC}
# Optional overrides (uncomment to use):
# - UNARR_API_KEY=tc_your_key_here
# - UNARR_API_URL=https://torrentclaw.com
# Resource limits — adjust to your needs
deploy:
resources:
limits:
memory: 512M
cpus: "2.0"
# Torrent P2P needs host network or explicit port range
# Option A: host network (simplest, full P2P performance)
network_mode: host network_mode: host
# Option B: bridge network with port mapping (more isolated) environment:
# Uncomment below and comment out network_mode above: # --- Required ---
- UNARR_API_KEY=${UNARR_API_KEY:?Set UNARR_API_KEY in .env or export it}
# --- Optional ---
# Server URL — change only if you run a self-hosted TorrentClaw instance
- UNARR_API_URL=${UNARR_API_URL:-https://torrentclaw.com}
- TZ=${TZ:-UTC}
volumes:
# Config: config.toml is auto-created here on first run.
# After first start, edit this file to set organize paths, quality, etc.
- ${CONFIG_DIR:-./config}:/config
# Downloads: where finished media is saved.
# Set DOWNLOAD_DIR in .env or export it before running.
- ${DOWNLOAD_DIR:?Set DOWNLOAD_DIR to your media folder}:/downloads
# Data: piece-completion DB, HLS cache, DHT nodes.
# Named volume keeps this off your media drive (avoids NFS locking issues).
- unarr-data:/data
# Optional: limit CPU/RAM for transcoding on shared hosts
# deploy:
# resources:
# limits:
# memory: 2G
# cpus: "4.0"
# --- macOS / Windows alternative (replace network_mode: host above) ---
# network_mode: bridge
# ports: # ports:
# - "6881-6889:6881-6889/tcp" # - "11818:11818" # direct stream (VLC, download)
# - "6881-6889:6881-6889/udp" # - "11819:11819" # HLS transcode (web player)
# - "42069:42069" # BitTorrent incoming peers
# Note: streaming will only reach devices on the same machine.
# For LAN / Tailscale playback use a Linux host with network_mode: host.
volumes: volumes:
unarr-data: unarr-data: