commit 24cafe26b0063ef6840654be3b3a88e973ebcd9d Author: Zepheris Date: Sun Nov 26 21:07:09 2017 -0700 Initial Commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..5a5008f --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Media_Automation +This project aims to build a docker container for personal use that will house the following applications: + +* Filebot +* Flexget +* Custom script that will automate finding and downloading episodes/movies \ No newline at end of file diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..9f32cdb --- /dev/null +++ b/dockerfile @@ -0,0 +1,35 @@ +FROM phusion/baseimage + +MAINTAINER Zepheris + +#RUN rm -f /etc/service/sshd/down + +# Regenerate SSH host keys. baseimage-docker does not contain any, so you +# have to do that yourself. You may also comment out this instruction; the +# init system will auto-generate one during boot. +#RUN /etc/my_init.d/00_regen_ssh_host_keys.sh + +CMD ["/sbin/my_init"] + +ENV PKGS deluge-console python-pip nano sshpass mediainfo openjdk-8-jre wget shellinabox rsync ffmpeg jq git +ENV TERM xterm +ENV LANG en_US.UTF-8 + +RUN apt-get update && \ + DEBIAN_FRONTEND=noninteractive apt-get install -y $PKGS && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +RUN pip install --upgrade pip && \ + pip install --upgrade setuptools &&\ + pip install flexget &&\ + pip install youtube-dl + +RUN wget -O /tmp/filebot.deb 'https://app.filebot.net/download.php?type=deb&arch=amd64' && \ + dpkg -i /tmp/filebot.deb && \ + rm /tmp/filebot.deb + +RUN useradd -u 99 -g 100 -m zepheris + +ADD startup.sh /etc/my_init.d/startup.sh +RUN chmod +x /etc/my_init.d/startup.sh diff --git a/science-chemistry-icon.png b/science-chemistry-icon.png new file mode 100644 index 0000000..34315d3 Binary files /dev/null and b/science-chemistry-icon.png differ diff --git a/startup.sh b/startup.sh new file mode 100644 index 0000000..03e80f0 --- /dev/null +++ b/startup.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#Check for a user password. If non, then set password to newpassword +if [ -z "$PASSWORD" ]; then + echo "Setting default SSH password to newpassword" + echo "zepheris:newpassword" | chpasswd +else + echo "SSH Password is $PASSWORD" + echo "zepheris:$PASSWORD" | chpasswd +fi + +chown zepheris:users -R /config/ +chown root:root /config/cron/cron_get + +if [ ! -d /home/zepheris/.filebot ]; then setuser zepheris ln -s /config/.filebot /home/zepheris/.filebot; fi +if [ ! -d /home/zepheris/.flexget ]; then setuser zepheris ln -s /config/.flexget /home/zepheris/.flexget; fi +if [ ! -d /home/zepheris/.ssh ]; then setuser zepheris ln -s /config/.ssh /home/zepheris/.ssh; fi +if [ ! -d /home/zepheris/.gitconfig ]; then setuser zepheris ln -s /config/.gitconfig /home/zepheris/.gitconfig; fi +if [ ! -d /home/zepheris/.bashrc ]; then setuser zepheris ln -s /config/.bashrc /home/zepheris/.bashrc; fi +if [ ! -f /etc/cron.d/cron_get ]; then ln -s /config/cron/cron_get /etc/cron.d/cron_get; fi + +#function to stop services and exit the container +_term() { + echo "Caught SIGTERM Signal" + echo "Stopping all services" + service shellinabox stop + + exit 0 +} + +trap 'kill ${!}; _term' SIGTERM + +echo -e "Starting Web SSH" +service shellinabox start