Installation
Docker
Section titled “Docker”docker pull martitoci/sonarr-analyzer:latest
docker run -d \ --name sonarr-analyzer \ -p 8501:8501 \ -p 8502:8502 \ -e TZ=America/New_York \ -v sonarr-data:/app/data \ --restart unless-stopped \ martitoci/sonarr-analyzer:latestThe web interface listens on port 8501 and the mobile API on 8502. Leave out -p 8502:8502 if you don’t use the mobile apps. To use another port on the host, change only the left side, for example -p 9000:8501, then open http://localhost:9000.
Hardened Compose file
Section titled “Hardened Compose file”The docker-compose.yml in the app repo adds a health check, no-new-privileges, a read-only root filesystem (the app only writes to /app/data and a /tmp tmpfs) and resource limits you can adjust to your library size:
services: sonarr-analyzer: image: martitoci/sonarr-analyzer:latest container_name: sonarr-analyzer ports: - "8501:8501" # Mobile API (iOS / Android apps); remove if you do not use them - "8502:8502" environment: - TZ=UTC # change to yours, e.g. America/New_York, Europe/Madrid # HTTPS without a reverse proxy (see Security) # - SONARR_ANALYZER_TLS=self-signed # - SONARR_ANALYZER_TLS_HOSTNAMES=nas.local,192.168.1.10 # Behind a reverse proxy: its IP or Docker network # - FORWARDED_ALLOW_IPS=172.18.0.0/16 volumes: - sonarr-data:/app/data restart: unless-stopped healthcheck: # Web app and mobile API, over https when SONARR_ANALYZER_TLS=self-signed test: ["CMD", "python", "-m", "sonarr_analyzer.healthcheck"] interval: 30s timeout: 10s retries: 3 start_period: 10s security_opt: - no-new-privileges:true read_only: true tmpfs: - /tmp deploy: resources: limits: cpus: '1.0' memory: 1G reservations: cpus: '0.5' memory: 512M
volumes: sonarr-data: driver: localBind mount instead of a volume
Section titled “Bind mount instead of a volume”To keep the data in a host folder, the folder must be writable by UID 1000, the user the container runs as:
mkdir -p ./sonarr-datasudo chown -R 1000:1000 ./sonarr-data # Linux/macOS
docker run -d \ --name sonarr-analyzer \ -p 8501:8501 \ -e TZ=America/New_York \ -v "$(pwd)"/sonarr-data:/app/data \ martitoci/sonarr-analyzer:latestThe entrypoint tries to fix ownership itself when the container starts as root. If you still get permission errors, see Troubleshooting or switch to a named volume.
The image
Section titled “The image”| Base image | python:3.12-slim-trixie |
| Architectures | linux/amd64, linux/arm64 |
| User | Non-root, UID 1000 (appuser); privileges dropped with setpriv |
| Processes | Streamlit web UI, a dedicated scheduler process and the mobile API (uvicorn, port 8502), the last two restarted automatically if they exit |
| Root filesystem | Read-only supported (read_only: true with a /tmp tmpfs) |
| Health check | Built in, Python-based (no curl needed): the web app and the API, over HTTPS when it’s on |
| Data | /app/data (volume) |
Image tags
Section titled “Image tags”| Tag | Description |
|---|---|
latest |
Latest published release |
vX.Y.Z |
A specific release, e.g. v0.7.0 |
Published: v0.7.0 (= latest), v0.6.2, v0.6.1 and v0.4.1 (the last build of the old v0.4 code, before the v0.5 rewrite).
Updating
Section titled “Updating”Back up, pull, recreate: see Upgrading.
Building from source
Section titled “Building from source”git clone https://github.com/chmedinap/sonarr-analyzer.gitcd sonarr-analyzer
docker build -t sonarr-analyzer:local .
docker run -d \ --name sonarr-analyzer \ -p 8501:8501 \ -e TZ=America/New_York \ -v sonarr-data:/app/data \ sonarr-analyzer:localRunning without Docker
Section titled “Running without Docker”Requires Python 3.12 or newer.
pip install -r requirements.txtstreamlit run app.pyData goes to ./data (override with SONARR_ANALYZER_DATA_DIR). Without Docker there is no separate scheduler process: scheduled analyses run in a thread that starts with the first page load.