My Sonarr Setup#
This Sonarr setup runs in a Docker container and is used to manage TV series downloads. It includes configurations for environment variables, volume mounts, and networking.
My Docker Compose Configuration#
services:
sonarr:
image: lscr.io/linuxserver/sonarr:latest # Sonarr latest image
container_name: sonarr # Container name for identification
environment:
- PUID=0 # Set user ID (root user)
- PGID=0 # Set group ID (root group)
- TZ=Europe/London # Set timezone
volumes:
- ~/sonarr/config:/config # Mount Sonarr configuration directory
- ~/downloads:/downloads # Mount downloads directory
- /mnt/main_nas/tv_shows:/main_nas/tv # Optional: Mount main NAS TV shows directory
- /mnt/sean_nas/tv_shows:/sean_nas/tv # Optional: Mount secondary NAS TV shows directory
ports:
- "8989:8989" # Expose port 8989 for the Sonarr web interface
restart: unless-stopped # Restart the container unless stopped manually
Using Docker Secrets for Environment Variables#
You can set any environment variable from a file by using a special prepend FILE__.
For example:
FILE__MYVAR=/run/secrets/mysecretvariable