diff --git a/cytec_sickrage/Dockerfile b/cytec_sickrage/Dockerfile new file mode 100644 index 0000000..74f4d0d --- /dev/null +++ b/cytec_sickrage/Dockerfile @@ -0,0 +1,21 @@ +FROM lsiobase/alpine.python:3.6 +MAINTAINER Michael Reber + +# set version label +ARG BUILD_DATE +ARG VERSION +LABEL build_version="Version:- ${VERSION} Build-date:- ${BUILD_DATE}" + +# set python to use utf-8 rather than ascii +ENV PYTHONIOENCODING="UTF-8" + +# install app +RUN \ + git clone --depth=1 https://github.com/cytec/SickRage.git /app/sickrage + +# copy local files +COPY root/ / + +# ports and volumes +EXPOSE 8081 +VOLUME /config /downloads /tv diff --git a/cytec_sickrage/root/etc/cont-init.d/30-config b/cytec_sickrage/root/etc/cont-init.d/30-config new file mode 100644 index 0000000..39d0c3c --- /dev/null +++ b/cytec_sickrage/root/etc/cont-init.d/30-config @@ -0,0 +1,6 @@ +#!/usr/bin/with-contenv bash + +# permissions +chown -R abc:abc \ + /app \ + /config diff --git a/cytec_sickrage/root/etc/services.d/sickrage/run b/cytec_sickrage/root/etc/services.d/sickrage/run new file mode 100644 index 0000000..52430fb --- /dev/null +++ b/cytec_sickrage/root/etc/services.d/sickrage/run @@ -0,0 +1,7 @@ +#!/usr/bin/with-contenv bash + +umask 022 + +exec \ + s6-setuidgid abc python /app/sickrage/SickBeard.py \ + --datadir /config diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..bdb7a91 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,213 @@ +version: '2' + +services: + # ---------------------------------------------------------------------------- + # Basic Services Deployment: + proxy: + build: proxy_nginx/ + container_name: "main-application-proxy" + ports: + - 80:80 + networks: + - local + restart: always + + muximux: + build: muximux_apache_php56/ + container_name: management-page + volumes: + - /opt/docker_data/muximux/html:/var/www/html + - /etc/localtime:/etc/localtime:ro + networks: + - local + #env_file: uidgid.env + #environment: + # - VIRTUAL_HOST=muximux.HOSTNAME.com + restart: always + + portainer: + image: portainer/portainer + container_name: "portainer-app" + #By adding <--host=unix:///var/run/docker.sock> to the command, I can automatically choose 'Manage the Docker instance over local socket' while docker starts. + command: --templates http://templates/templates.json --host=unix:///var/run/docker.sock + networks: + - local + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - /opt/docker_data/portainer/data:/data + - /opt/docker_data/portainer/data/tls:/data/tls + restart: always + + templates: + image: portainer/templates + container_name: "portainer-templates" + networks: + - local + restart: always + + watchtower: + image: v2tec/watchtower + container_name: "portainer-watchtower" + command: --cleanup portainer-app portainer-watchtower portainer/templates + networks: + - local + volumes: + - /var/run/docker.sock:/var/run/docker.sock + restart: always + + # ---------------------------------------------------------------------------- + # Usenet Service Deployment: + + nzbhydra: + image: linuxserver/hydra + container_name: nzbhydra + volumes: + - /opt/docker_data/nzbhydra/config:/config + - /etc/localtime:/etc/localtime:ro + - /mnt/blackserv/Downloads:/downloads + ports: + - 5075:5075 + networks: + - local + #env_file: uidgid.env + #environment: + # - VIRTUAL_HOST=nzbhydra.HOSTNAME.com + # - VIRTUAL_PORT=5075 + restart: always + + sabnzbd: + image: linuxserver/sabnzbd:latest + container_name: sabnzbd + volumes: + - /opt/docker_data/sabnzbd/config:/config + # TODO CHANDE PATH TO CORRECT /MNT/BLACKSERV + - /mnt/blackserv/Downloads/complete:/downloads + - /mnt/blackserv/Downloads/incomplete:/incomplete-downloads + ports: + - 8080:8080 + networks: + - local + #network_mode: "bridge" + #env_file: uidgid.env + #environment: + # - EDGE=1 + # - VIRTUAL_HOST=sabnzbd.HOSTNAME.com + # - VIRTUAL_PORT=8080 + restart: always + + nzbget: + image: linuxserver/nzbget + container_name: nzbget + volumes: + - /opt/docker_data/nzbget/config:/config + - /mnt/blackserv/Downloads/complete:/complete + - /mnt/blackserv/Downloads:/downloads + ports: + - 6789:6789 + networks: + - local + #env_file: uidgid.env + #environment: + # - VIRTUAL_HOST=nzbget.HOSTNAME.com + # - VIRTUAL_PORT=6789 + restart: always + + + couchpotato: + image: linuxserver/couchpotato:latest + container_name: couchpotato + volumes: + - /opt/docker_data/couchpotato/config:/config + - /mnt/blackserv/Downloads/complete:/downloads + - /mnt/blackserv/Movies:/movies + ports: + - 5050:5050 + networks: + - local + #env_file: uidgid.env + #environment: + # - VIRTUAL_HOST=couchpotato.HOSTNAME.com + # - VIRTUAL_PORT=5050 + restart: always + + sonarr: + image: linuxserver/sonarr + container_name: sonarr + volumes: + - /opt/docker_data/sonarr/config:/config + - /etc/localtime:/etc/localtime:ro + - /mnt/blackserv/TV:/tv + - /mnt/blackserv/Downloads/complete:/downloads + ports: + - 8989:8989 + networks: + - local + #env_file: uidgid.env + #environment: + # - VIRTUAL_HOST=sonarr.HOSTNAME.com + # - VIRTUAL_PORT=8989 + restart: always + + radarr: + image: linuxserver/radarr + container_name: radarr + volumes: + - /opt/docker_data/radarr/config:/config + - /etc/localtime:/etc/localtime:ro + - /mnt/blackserv/Movies:/movies + - /mnt/blackserv/Downloads/complete:/downloads + ports: + - 7878:7878 + networks: + - local + #env_file: uidgid.env + #environment: + # - VIRTUAL_HOST=radarr.HOSTNAME.com + # - VIRTUAL_PORT=7878 + restart: always + + sickrage: + build: cytec_sickrage/ + container_name: cytec_sickrage + volumes: + - /opt/docker_data/cytec_sickrage/config:/config + - /etc/localtime:/etc/localtime:ro + - /mnt/blackserv/TV:/tv + - /mnt/blackserv/Downloads:/downloads + ports: + - 8081:8081 + networks: + - local + restart: always + + headphones: + image: linuxserver/headphones + container_name: headphones + volumes: + - /opt/docker_data/headphones/config:/config + - /etc/localtime:/etc/localtime:ro + - /mnt/blackserv/Downloads/music:/music + - /mnt/blackserv/Downloads:/downloads + ports: + - 8181:8181 + networks: + - local + restart: always + + glances: + image: nicolargo/glances + container_name: glances_monitoring + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + ports: + - 61208-61209:61208-61209 + networks: + - local + environment: + - GLANCES_OPT=-w + restart: always + +# ------------------------------------------------------------------------------ +networks: + local: + driver: bridge diff --git a/muximux_apache_php56/Dockerfile b/muximux_apache_php56/Dockerfile new file mode 100644 index 0000000..7098057 --- /dev/null +++ b/muximux_apache_php56/Dockerfile @@ -0,0 +1,32 @@ +FROM php:5.6-apache + +MAINTAINER Michael Reber + +# Install packages +RUN apt-get update && apt-get install -y \ + libbz2-dev \ + libfreetype6-dev \ + libgd-dev \ + libjpeg62-turbo-dev \ + libmcrypt-dev \ + libpng12-dev \ + libxml2-dev \ + zlib1g-dev \ + git \ + && docker-php-ext-install iconv mbstring mcrypt soap sockets zip \ + && docker-php-ext-configure gd --enable-gd-native-ttf --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ + && docker-php-ext-install gd \ + && a2enmod rewrite headers + +VOLUME /var/www/html + +# Entrypoint file which download the GitProject: +COPY ./files/gitclone.sh /scripts/gitclone.sh +RUN chmod -R 755 /scripts + +# Copy pre-modifiey settings.ini.php for blgusenetcompose: +COPY ./files/settings.ini.php /scripts/settings.ini.php + +EXPOSE 80 + +ENTRYPOINT /scripts/gitclone.sh && /usr/sbin/apache2ctl -D FOREGROUND \ No newline at end of file diff --git a/muximux_apache_php56/files/gitclone.sh b/muximux_apache_php56/files/gitclone.sh new file mode 100644 index 0000000..85dc8c1 --- /dev/null +++ b/muximux_apache_php56/files/gitclone.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# fetch site +[[ ! -d /var/www/html/.git ]] && \ + git clone https://github.com/mescon/Muximux /var/www/html && \ + mv /scripts/settings.ini.php /var/www/html/settings.ini.php + +# permissions +chown -R www-data:www-data /var/www/html \ No newline at end of file diff --git a/muximux_apache_php56/files/settings.ini.php b/muximux_apache_php56/files/settings.ini.php new file mode 100644 index 0000000..0763557 --- /dev/null +++ b/muximux_apache_php56/files/settings.ini.php @@ -0,0 +1,156 @@ +; +[general] +title = "Main - Application Management Console" +branch = "master" +theme = "modern" +color = "#31ac63" +tabcolor = "true" +rssUrl = "https://www.wired.com/feed/" +userNameInput = "admin" +password = "muximux" + +[settings] +branch_changed = "" +sha = "66b11488206b44364b6ed8bb438462cbbb0835c5" +enabled = "true" +default = "false" +name = "Settings" +url = "muximux.php" +landingpage = "false" +icon = "fa-cog" +dd = "true" +branches[develop] = "f1135f2a0a7d6d69dbcb086bd71d5e8bee6447c3" +branches[experimental] = "262b1a4c4ca6fa0386e46400211604d66c0bd22d" +branches[master] = "66b11488206b44364b6ed8bb438462cbbb0835c5" +branches[parseError] = "14ea3581389e329e27c496367b2b85b15fc106f9" +branches[saveProblem] = "4d16f3f4b1d7fb18bac5d8ed09b9a45dbe6711ff" +last_check = 1512476785 + +[nzbhydra] +name = "NZB Hydra" +url = "/nzbhydra" +scale = 1 +icon = "muximux-nzbhydra" +color = "#108f34" +enabled = "true" +default = "true" + +[Couchpotato] +name = "CouchPotato" +url = "/couchpotato" +scale = 1 +icon = "muximux-couchpotato" +color = "#f85c22" +enabled = "true" + +[Sonarr] +name = "Sonarr" +url = "/sonarr" +scale = 1 +icon = "muximux-sonarr" +color = "#35c5f4" +enabled = "true" + +[Radarr] +name = "Radarr" +url = "/radarr" +scale = 1 +icon = "muximux-sonarr" +color = "#3d6fae" +enabled = "true" + +[Sickbeard] +name = "SickBeard" +url = "/sickbeard" +scale = 1 +icon = "muximux-sickbeard" +color = "#b6f000" +enabled = "false" + +[Sickrage] +name = "SickRage" +url = "/sickrage-cytec" +scale = 1 +icon = "muximux-sickrage" +color = "#b6f000" +enabled = "true" + + +[NZBGet] +name = "NZBGet" +url = "/nzbget" +scale = 1 +icon = "muximux-download" +color = "#3f8927" +enabled = "true" +dd = "true" + +[SABnzbd] +name = "SABnzbd" +url = "/sabnzbd" +scale = 1 +icon = "muximux-arrow-down" +color = "#f5b907" +enabled = "true" +dd = "true" + +[RuTorrent] +name = "RuTorrent" +url = "https://github.com/Novik/ruTorrent" +scale = 1 +icon = "muximux-rutorrent" +color = "#1a1bfe" +enabled = "false" +dd = "true" + +[pydio] +name = "Pydio" +url = "https://pydio.com/" +scale = 1 +icon = "muximux-cloud" +color = "#cc6156" +enabled = "false" +dd = "true" + +[Headphones] +name = "Headphones" +url = "/headphones" +scale = 1 +icon = "muximux-headphones" +color = "#000000" +enabled = "true" + +[PlexPy] +name = "PlexPy" +url = "https://jonnywong16.github.io/plexpy/" +scale = 1 +icon = "muximux-plexivity" +color = "#cc7b19" +enabled = "false" +dd = "true" + +[Glances] +name = "Glances" +url = "/glances" +scale = 1 +icon = "muximux-eye" +color = "#59D16C" +enabled = "false" + +[deluge] +name = "Deluge" +url = "http://deluge-torrent.org/" +scale = 1 +icon = "muximux-deluge" +color = "#304663" +enabled = "false" +dd = "true" + +[Portainer] +name = "Portainer" +url = "/portainer" +scale = 1 +icon = "muximux-server" +color = "#304663" +enabled = "true" +dd = "true" diff --git a/proxy_nginx/Dockerfile b/proxy_nginx/Dockerfile new file mode 100644 index 0000000..1b26ed9 --- /dev/null +++ b/proxy_nginx/Dockerfile @@ -0,0 +1,4 @@ +FROM nginx:alpine + +RUN rm -v /etc/nginx/conf.d/* +COPY config/localproxy.conf /etc/nginx/conf.d/localproxy.conf diff --git a/proxy_nginx/config/localproxy.conf b/proxy_nginx/config/localproxy.conf new file mode 100644 index 0000000..4295763 --- /dev/null +++ b/proxy_nginx/config/localproxy.conf @@ -0,0 +1,82 @@ + +server { + listen 80; + + location / { + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_pass http://muximux/; + } + location /portainer/ { + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_pass http://portainer:9000/; + } + location /portainer/api/websocket/ { + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_http_version 1.1; + proxy_pass http://portainer:9000/api/websocket/; + } + location /nzbhydra/ { + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_pass http://nzbhydra:5075; + } + location /couchpotato/ { + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_pass http://couchpotato:5050; + } + location /sonarr/ { + proxy_http_version 1.1; + proxy_pass http://sonarr:8989; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_redirect off; + } + location /radarr/ { + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_pass http://radarr:7878; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_redirect off; + } + location /sickrage-cytec/ { + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_pass http://sickrage:8081; + } + location /nzbget/ { + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_pass http://nzbget:6789; + } + location /sabnzbd/ { + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_pass http://sabnzbd:8080; + } + location /glances/ { + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_pass http://glances:61208; + } + location /headphones/ { + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_pass http://headphones:8181; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_redirect off; + + } + +} diff --git a/scripts/_Initial_fix_persistant_settings_forReverseProxy.sh b/scripts/_Initial_fix_persistant_settings_forReverseProxy.sh new file mode 100644 index 0000000..572e558 --- /dev/null +++ b/scripts/_Initial_fix_persistant_settings_forReverseProxy.sh @@ -0,0 +1,21 @@ +#!/bin/bash + + +#Fix for NZB-Hydra: +sed -e 's/"urlBase": null,/"urlBase": "/nzbhydra",/' -i /opt/docker_data/nzbhydra/config/hydra/settings.cfg + +#Fix for couchpotato: +sed -e 's/url_base = /url_base = \/couchpotato/' -i /opt/docker_data/couchpotato/config/config.ini + +#Fix for sonarr: +sed -e 's/<\/UrlBase>/\/sonarr<\/UrlBase>/' -i /opt/docker_data/sonarr/config/config.xml + +#Fix for radarr: +sed -e 's/<\/UrlBase>/\/radarr<\/UrlBase>/' -i /opt/docker_data/radarr/config/config.xml + +# Fix for Headphones: +sed -e 's/http_root = \//http_root = \/headphones\//' -i /opt/docker_data/headphones/config/config.ini + + + +docker-compose restart nzbhydra couchpotato sonarr radarr headphones