Skip to content

Instantly share code, notes, and snippets.

@dhc02
Created May 24, 2022 19:27
Show Gist options
  • Save dhc02/32055e824bfe64a4de1cd07382da641a to your computer and use it in GitHub Desktop.
Save dhc02/32055e824bfe64a4de1cd07382da641a to your computer and use it in GitHub Desktop.
example docker compose and caddy config for plex, radarr, sonarr, etc.
{
email [email protected]
}
###
# Some services use paths on my main domain, such as home.domain/sonarr.
# Others use subdomains, such as plex.home.domain.
# If I were starting over, I'd use all subdomains. Caddy just magically
# obtains SSL certificates for subdomains, some services require some
# extra work and configuration to work at a path.
###
# I've left my internal IP and port addresses as examples, but you'll
# want to change them all to match the actual IPs for your services.
#
# Also, some of the ports I use are not the standard ports for those services.
# So make sure to use the real port your services use and/or you map in your
# docker-compose.yml.
###
###
# Main Domain
###
home.domain {
reverse_proxy 192.168.200.3:41180 # Heimdall at the root domain
reverse_proxy /sonarr* 192.168.200.3:8084 # Sonarr
# Sabnzbd
# The transport http section is only necessary because I configured
# sabnzbd to use https a long time ago. You probably don't need this,
# but I thought I'd leave it in so you can see how to handle accessing
# a service over https without a valid certificate.
reverse_proxy /sabnzbd* https://192.168.200.3:9090 {
transport http {
tls_insecure_skip_verify
}
}
reverse_proxy /tautulli* 192.168.200.3:41105 # tautulli
reverse_proxy /radarr* 192.168.200.3:7878 # radarr
reverse_proxy /lidarr* 192.168.200.3:8686 # lidarr
reverse_proxy /bazarr* 192.168.200.3:6767 # bazarr
reverse_proxy /readarr* 192.168.200.3:8787 # readarr
reverse_proxy /nzbhydra* 192.168.200.3:5076 # nzbhydra
reverse_proxy /jackett* 192.168.200.3:9117 # jackett
reverse_proxy /lazylibrarian* 192.168.200.3:5299 # lazylibrarian
}
# Second radarr instance for 4K movie collection
radarr4k.home.domain {
reverse_proxy 192.168.200.3:7879
}
# Homeassistant
ha.home.domain {
# I couldn't get homeassistant to work via IP address, so had to resort to this
reverse_proxy homeassistant.local:8123
}
# Pihole 1
pihole1.home.domain {
reverse_proxy 192.168.200.5
}
# Pihole 2
pihole2.home.domain {
reverse_proxy 192.168.200.171
}
# Calibre-web
books.home.domain {
reverse_proxy 192.168.200.3:41110 {
}
}
# Unifi network management
unifi.home.domain {
reverse_proxy 192.168.200.5:8443 {
transport http {
tls_insecure_skip_verify
}
}
}
# Ombi for family members to request media to add to plex
ombi.home.domain, tv.home.domain, movies.home.domain, requests.home.domain {
reverse_proxy 192.168.200.3:3579 {
}
}
# qBittorrent
qb.home.domain {
reverse_proxy 192.168.200.3:9091 {
# header_up Host 192.168.200.3:9091
# header_up X-Forwarded-Host {hostport}
# header_up -Origin
# header_up -Referer
}
}
# Plex
# (Note: you want to turn off automatic remote access in Plex settings and manualy add
# this domain. Annoyingly, Plex settings will always show an error icon next to remote
# access, but it works anyway.)
plex.home.domain {
reverse_proxy 192.168.200.3:32400
}
# Calibre
calibre.home.domain {
reverse_proxy 192.168.200.3:7979
}
# TO RELOAD CADDY after config changes without restarting container:
# 1. start a docker shell in the Caddy container
# 2. cd /etc/caddy
# 3. caddy reload
version: "3.7"
###
# This lives, for me, in a /caddy folder inside my main /docker folder. I run
# docker compose up -d twice - once in the main docker folder, and once in
# the caddy folder.
#
# I don't think there is any advantage to doing it like this, instead of adding
# Caddy in as another entry in the main docker-compose.yml file. But when I was
# first playing around with Caddy, I wasn't sure if I was going to use it, and I
# wanted to keep it separate, and it worked, so I never changed it.
###
services:
caddy:
image: caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
environment:
- PUID=197608
- PGID=197121
- TZ=America/Chicago
volumes:
- //c/Users/EXAMPLE/Programs/docker/caddy/config:/config
- //c/Users/EXAMPLE/Programs/docker/caddy/data:/data
- //c/Users/EXAMPLE/Programs/docker/caddy/site:/srv
- //c/Users/EXAMPLE/Programs/docker/caddy/Caddyfile:/etc/caddy/Caddyfile
---
version: "2.1"
###
# I use a folder in my windows home directory called Programs for all this stuff, and specifically
# C:\users\EXAMPLE\Programs\docker for this main docker-compose.yml and the config directories
# for all the services.
#
# In most cases, you can map a docker mount point by using '.' to specify relative locations
# for folders (like in the tautulli example), but in some cases I've had issues until I
# fully write out the path using the '//c/users/Example/Programs/docker/' notation. In either
# case, docker doesn't work if you use Windows path notation, like 'C:\example\path'
###
services:
tautulli:
image: ghcr.io/linuxserver/tautulli
container_name: tautulli
# I've read that it helps on Windows to always include the PUID and PGID for each container
# No idea if that's actually true. You find yours by typing the following at a
# windows command prompt:
# > id -u
# > id -g
environment:
- PUID=197608
- PGID=197121
- TZ=America/Chicago
volumes:
- ./tautulli/config:/config
ports:
- 41105:8181
restart: unless-stopped
radarr4k:
image: lscr.io/linuxserver/radarr:latest
container_name: radarr4k
environment:
- PUID=197608
- PGID=197121
- TZ=America/Chicago
volumes:
- //c/Users/EXAMPLE/Programs/docker/radarr4k/config:/config
- //z/Videos:/data/Z/Videos #optional
- //x/video:/data/X/video
- //c/Users/EXAMPLE/Downloads:/downloads #optional
ports:
- 7879:7878
restart: unless-stopped
calibre-web:
image: ghcr.io/linuxserver/calibre-web
container_name: calibre-web
environment:
- PUID=197608
- PGID=197121
- TZ=America/Chicago
- DOCKER_MODS=linuxserver/calibre-web:calibre
volumes:
- //c/Users/EXAMPLE/Programs/docker/calibre-web:/config
- //z/Dropbox/eBooks:/books
ports:
- 41110:8083
restart: unless-stopped
nzbhydra2:
image: ghcr.io/linuxserver/nzbhydra2
container_name: nzbhydra2
environment:
- PUID=197608
- PGID=197121
- TZ=America/Chicago
volumes:
- //c/Users/EXAMPLE/Programs/docker/nzbhydra2:/config
- //c/Users/EXAMPLE/Downloads:/downloads
ports:
- 5076:5076
restart: unless-stopped
jackett:
image: ghcr.io/linuxserver/jackett
container_name: jackett
environment:
- PUID=197608
- PGID=197121
- TZ=America/Chicago
- AUTO_UPDATE=true
# - RUN_OPTS=<run options here>
volumes:
- //c/Users/EXAMPLE/Programs/docker/jackett:/config
- //c/Users/EXAMPLE/Downloads/torrents:/downloads
ports:
- 9117:9117
restart: unless-stopped
bazarr:
image: ghcr.io/linuxserver/bazarr
container_name: bazarr
environment:
- PUID=197608
- PGID=197121
- TZ=America/Chicago
volumes:
- //c/Users/EXAMPLE/Programs/docker/bazarr:/config
- //c/Users/EXAMPLE/Downloads:/downloads
- //z/Videos/Movies:/movies
- //z/Videos/TV:/TV
ports:
- 6767:6767
restart: unless-stopped
heimdall:
image: ghcr.io/linuxserver/heimdall
container_name: heimdall
environment:
- PUID=197608
- PGID=197121
- TZ=America/Chicago
volumes:
- //c/Users/EXAMPLE/Programs/docker/heimdall:/config
ports:
- 41180:80
- 41143:443
restart: unless-stopped
ombi:
image: ghcr.io/linuxserver/ombi
container_name: ombi
environment:
- PUID=197608
- PGID=197121
- TZ=America/Chicago
# - BASE_URL=/ombi #optional
volumes:
- //c/Users/EXAMPLE/Programs/docker/ombi:/config
ports:
- 3579:3579
restart: unless-stopped
readarr:
image: ghcr.io/linuxserver/readarr:nightly
container_name: readarr
environment:
- PUID=197608
- PGID=197121
- TZ=America/Chicago
volumes:
- //c/Users/EXAMPLE/Programs/docker/readarr:/config
- //z/Dropbox/eBooks:/books
- //c/Users/EXAMPLE/Downloads:/downloads
- //z/Dropbox/Audiobooks:/audiobooks
ports:
- 8787:8787
restart: unless-stopped
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment