Skip to content

Instantly share code, notes, and snippets.

@gryte
Last active December 2, 2016 03:30
Show Gist options
  • Save gryte/6cb613b868aad3736caf27649c1dbb93 to your computer and use it in GitHub Desktop.
Save gryte/6cb613b868aad3736caf27649c1dbb93 to your computer and use it in GitHub Desktop.
Docker Container - Sonarr and Couch

Summary

The goal is to migrate an existing instance of Sonarr and Couch from a stand-alone CentOS 7 vm to a Docker container on a separate CentOS 7 vm running Docker. The idea is that Sonarr and Couch does not appear to need all of the overhead that comes with running an entire OS on a separate VM. We will attempt to consolidate resources leveraging containers as appropriate.

Layout

Virtual Environment - Proxmox

All of the host servers mentioned are virtual machines running CentOS 7 managed in a Proxmox environment.

TV Library - Plex Media Server

The existing NFS share on the Plex server was updated (/etc/exports) to allow the Docker server access.

Download Client - Deluge Server

The existing Deluge Server also has an NFS share that needs to be updated to allow the Docker server access.

TV Personal Video Recorder (PVR) - Sonarr

The existing server is it's own CentOS 7 virtual machine. We will be backing up the configuration data from the existing server and using it to migrate to a new Sonarr instance running in a Docker container on the Docker server.

Movie Personal Video Recorder (PVR) - CouchPotato

The existing server is it's own CentOS 7 virtual machine. We will be backing up the configuration data from the existing server and using it to migrate to a new Couch instance running in a Docker container on the Docker server.

Sonarr Work Flow

The main use for Sonarr is configuring it to monitor a location on the Deluge server for new TV shows and move them appropriately to the Plex server.

# main functionality
TV show episode --> downloaded by Deluge server --> managed by Sonarr instance --> lands appropriately on Plex server

Couch Work Flow

The main use for Couch is configuring it to monitor a location on the Deluge server for new movies and move them appropriately to the Plex server.

# main functionality
Movie --> downloaded by Deluge server --> managed by Couch instance --> lands appropriately on Plex server

Prep/Work

  1. expose plex nfs share to docker server ip
  • mount nfs share from docker server to plex server
  • expose deluge server nfs share to docker server ip
  • mount nfs share from docker server to deluge server ip
  • grab backup of current sonarr server
  • grab backup of current couch server
  • create sonarr config directory on docker server
  • create sonarr config directory on docker server
  • scp the sonarr backup zip file to docker server
  • scp the couch backup ini file to docker server
  • unzip sonarr backup into sonarr config directory on docker server
  • pull down sonarr docker image
  • pull down couch docker image
  • run sonarr container with parameters
  • run couch container with parameters
  • validate sonarr in container
  • validate couch in container
  • shut down old sonarr server vm
  • shut down old couch server vm

Create Container

This is the command used to create the Sonarr container as per the Docker Hub page for the image.

docker create \
    --name sonarr \
    -p 8989:8989 \
    -e PUID=0 -e PGID=0 \
    -v /dev/rtc:/dev/rtc:ro \
    -v /app/config/sonarr:/config \
    -v /mnt/nfs/tvshows:/mnt/nfs/tvshows \
    -v /mnt/nfs/deluge/complete/tv:/mnt/nfs/deluge/complete/tv \
    linuxserver/sonarr

This is the command used to create the Couch container as per the Docker Hub page for the image.

docker create \
    --name=couchpotato \
    -v /app/config/couch:/config \
    -v /mnt/nfs/deluge/complete/movie:/mnt/nfs/deluge/complete/movie \
    -v /mnt/nfs/movies:/mnt/nfs/movies \
    -e PGID=0 -e PUID=0  \
    -e TZ=America/Chicago \
    -p 5050:5050 \
    linuxserver/couchpotato

Update Image/Container

# list running containers and grab id
docker ps -a

# stop running container based on id
docker stop <container id>

# remove container
docker rm <container id>

# list images and grab id
docker images

# remove image
docker rmi <image id>

# pull down latest update
docker pull <repo/image>

# create image
<use create commands above>

# list new container id's
docker ps -a

# start container with updated image
docker start <container id>

Citations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment