Add Sonarr container and some changes to frontend

Sonarr
 - Add support for http://sonarr.tv/ in its own docker container

 Frontend
 - Add sonarr as a endpoint for the frontend proxy
 - Don't resolve hostnames initially which fixes an longstanding issue
   where nginx will crash if the other containers aren't up since their
   hostnames won't be resolvable:
     - Set resolver to 127.0.0.11 which is Docker's DNS for resolving
       services
     - Removed upstream block and declared upstream in set statements

Signed-off-by: Kelvin Chen <kelvin@kelvinchen.org>
This commit is contained in:
Kelvin Chen 2016-10-07 23:21:49 -04:00
parent bb83ddd2e7
commit 09475ed565
5 changed files with 59 additions and 24 deletions

View File

@ -34,28 +34,16 @@ http {
auth_basic "Restricted"; auth_basic "Restricted";
auth_basic_user_file .htpasswd; auth_basic_user_file .htpasswd;
upstream rtorrent { # Use builtin Docker DNS as resolver for services
server rtorrent; resolver 127.0.0.11;
}
upstream syncthing {
server syncthing:8384;
}
upstream plex {
server plex:32400;
}
upstream sickrage {
server sickrage:8081;
}
server { server {
include common.conf; include common.conf;
server_name ~^(rtorrent)(\.\w+)+$; server_name ~^(rtorrent)(\.\w+)+$;
location / { location / {
proxy_pass http://rtorrent; set $rtorrent http://rtorrent:80;
proxy_pass $rtorrent;
} }
} }
@ -64,7 +52,8 @@ http {
server_name ~^(sickrage)(\.\w+)+$; server_name ~^(sickrage)(\.\w+)+$;
location / { location / {
proxy_pass http://sickrage; set $sickrage http://sickrage:8081;
proxy_pass $sickrage;
} }
} }
@ -73,7 +62,8 @@ http {
server_name ~^(syncthing)(\.\w+)+$; server_name ~^(syncthing)(\.\w+)+$;
location / { location / {
proxy_pass http://syncthing; set $syncthing http://syncthing:8384;
proxy_pass $syncthing;
} }
} }
@ -82,7 +72,18 @@ http {
server_name ~^(plex)(\.\w+)+$; server_name ~^(plex)(\.\w+)+$;
location / { location / {
proxy_pass http://plex; set $plex http://plex:32400;
proxy_pass $plex;
}
}
server {
include common.conf;
server_name ~^(sonarr)(\.\w+)+$;
location / {
set $sonarr http://sonarr:8989;
proxy_pass $sonarr;
} }
} }
} }

View File

@ -0,0 +1,18 @@
FROM buildpack-deps:xenial-scm
MAINTAINER Kelvin Chen <kelvin@kelvinchen.org>
# Install Sonarr
RUN echo "deb http://apt.sonarr.tv/ master main" \
> /etc/apt/sources.list.d/sonarr.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC \
&& apt-get update \
&& apt-get install -y nzbdrone \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
VOLUME /config
EXPOSE 8989
COPY init /
CMD ["/init"]

5
Dockerfiles/sonarr/init Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env sh
mkdir -p /config/sonarr
mono /opt/NzbDrone/NzbDrone.exe -nobrowser -data=/config/sonarr

View File

@ -1,12 +1,13 @@
# Seedbox # Seedbox
A collection of Dockerfiles and docker-compose configuration to set up a A collection of Dockerfiles and a docker-compose configuration to set up a
seedbox. seedbox and personal media server.
## Accessing the available WebUIs ## Accessing a Service's Web Interface
Go to `X.domain` where `X` is the item you want to access. Go to `x.hostname` where `x` is the service you want to access.
Included items are: Included services are:
- rtorrent - rtorrent
- sickrage - sickrage
- sonarr
- syncthing - syncthing
- plex - plex

View File

@ -62,6 +62,16 @@ services:
- config:/config - config:/config
- torrents:/torrents - torrents:/torrents
sonarr:
image: kelvinchen/seedbox:sonarr
build: Dockerfiles/sonarr
restart: always
networks:
- main
volumes:
- config:/config
- torrents:/torrents
syncthing: syncthing:
image: kelvinchen/seedbox:syncthing image: kelvinchen/seedbox:syncthing
build: Dockerfiles/syncthing build: Dockerfiles/syncthing