mirror of
https://github.com/Adam-Ant/media-server-in-a-box
synced 2024-12-20 14:44:34 +00:00
Initial Commit
This commit is contained in:
commit
218bc0602e
92
docker-compose.yml
Normal file
92
docker-compose.yml
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
data:
|
||||||
|
image: tianon/true
|
||||||
|
volumes:
|
||||||
|
- $VOLDIR:/config
|
||||||
|
|
||||||
|
nzbget:
|
||||||
|
image: adamant/nzbget
|
||||||
|
depends_on:
|
||||||
|
- data
|
||||||
|
volumes_from:
|
||||||
|
- data
|
||||||
|
- container:media
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "6789:6789"
|
||||||
|
|
||||||
|
deluge:
|
||||||
|
image: adamant/deluge
|
||||||
|
depends_on:
|
||||||
|
- data
|
||||||
|
volumes_from:
|
||||||
|
- data
|
||||||
|
- container:media
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "8112:8112"
|
||||||
|
- "58846:58846"
|
||||||
|
- "53160:53160"
|
||||||
|
- "53160:53160/udp"
|
||||||
|
|
||||||
|
sickrage:
|
||||||
|
image: adamant/sickrage
|
||||||
|
depends_on:
|
||||||
|
- deluge
|
||||||
|
- nzbget
|
||||||
|
volumes_from:
|
||||||
|
- data
|
||||||
|
- container:media
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "8081:8081"
|
||||||
|
|
||||||
|
couchpotato:
|
||||||
|
image: adamant/couchpotato
|
||||||
|
depends_on:
|
||||||
|
- deluge
|
||||||
|
- nzbget
|
||||||
|
volumes_from:
|
||||||
|
- data
|
||||||
|
- container:media
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "5050:5050"
|
||||||
|
|
||||||
|
headphones:
|
||||||
|
image: adamant/headphones
|
||||||
|
depends_on:
|
||||||
|
- deluge
|
||||||
|
- nzbget
|
||||||
|
volumes_from:
|
||||||
|
- data
|
||||||
|
- container:media
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "8181:8181"
|
||||||
|
|
||||||
|
plex:
|
||||||
|
image: adamant/alpine-plex
|
||||||
|
depends_on:
|
||||||
|
- sickrage
|
||||||
|
- couchpotato
|
||||||
|
- headphones
|
||||||
|
volumes_from:
|
||||||
|
- data
|
||||||
|
- container:media
|
||||||
|
restart: always
|
||||||
|
network_mode: "host"
|
||||||
|
ports:
|
||||||
|
- "32400:32400"
|
||||||
|
|
||||||
|
plexpy:
|
||||||
|
image: adamant/plexpy
|
||||||
|
depends_on:
|
||||||
|
- plex
|
||||||
|
volumes_from:
|
||||||
|
- data
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "8182:8181"
|
44
start.sh
Normal file
44
start.sh
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
### Script for building and running a media processing system using docker
|
||||||
|
### Adam Dodman <adam.dodman@gmx.com>
|
||||||
|
# Prereqs: docker, docker-compose, curl (https)
|
||||||
|
|
||||||
|
export VOLDIR="/root/volumestest/media"
|
||||||
|
SERVICES=("couchpotato" "deluge" "headphones" "nzbget" "plex" "plexpy" "sickrage")
|
||||||
|
SERVICEUID=("745" "647" "526" "236" "787" "426" "439")
|
||||||
|
|
||||||
|
DOCKER_TLS_VERIFY="1"
|
||||||
|
DOCKER_HOST="tcp://192.168.1.4:2376"
|
||||||
|
DOCKER_CERT_PATH="/home/adam/.docker/machine/machines/DockerDev"
|
||||||
|
DOCKER_MACHINE_NAME="DockerDev"
|
||||||
|
|
||||||
|
|
||||||
|
[[ $EUID -ne 0 ]] && echo "Please run this script as root" && exit 1
|
||||||
|
|
||||||
|
|
||||||
|
#Check if docker is installed and running
|
||||||
|
docker version &> /dev/null
|
||||||
|
#[[ $? -ne 0 ]] && echo "Cannot connect to Docker daemon. Please check your configuration." && exit 1
|
||||||
|
#Check if docker-compose is installed
|
||||||
|
docker-compose version &> /dev/null
|
||||||
|
[[ $? -ne 0 ]] && echo "docker-compose not found. Please check your configuration." && exit 1
|
||||||
|
# Check if media container is configured
|
||||||
|
[[ $(docker ps -a --filter="name=media" | wc -l) != "2" ]] && echo "Cannot find a media container - please configure one with your media mounted at /media inside the container before running this script (to keep the size down use tianon/true)" && exit 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Check if volumes folder exists
|
||||||
|
[[ ! -d $VOLDIR ]] && echo "Creating volumes folder..." && mkdir -p $VOLDIR
|
||||||
|
[[ ! -d $VOLDIR/couchpotato ]]
|
||||||
|
|
||||||
|
|
||||||
|
slen=${#SERVICES[@]}
|
||||||
|
for ((i=0; i<$slen; i++)); do
|
||||||
|
[[ ! -d $VOLDIR/${SERVICES[$i]} ]] && echo "Creating folder $VOLDIR/${SERVICES[$i]}" && mkdir -p $VOLDIR/${SERVICES[$i]}
|
||||||
|
[[ $( ls -dn $VOLDIR/${SERVICES[$i]} | awk '{print $3}') != ${SERVICEUID[$i]} ]] && echo "Chowning $VOLDIR/${SERVICES[$i]} to user ${SERVICEUID[$i]}" && chown ${SERVICEUID[$i]}:${SERVICEUID[$i]} $VOLDIR/${SERVICES[$i]}
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
[[ ! -a $VOLDIR/docker-compose.yml ]] && echo "Downloading docker-compose.yml.." && curl -sSL https://raw.githubusercontent.com/Adam-Ant/media-in-a-box/master/docker-compose.yml > $VOLDIR/media-compose.yml
|
||||||
|
echo "Starting services..."
|
||||||
|
exec docker-compose -p media -f $VOLDIR/media-compose.yml up -d
|
Loading…
Reference in New Issue
Block a user