Skip to content

Commit

Permalink
✨ apps + appdata
Browse files Browse the repository at this point in the history
  • Loading branch information
juftin committed Apr 11, 2024
1 parent 5a5ae4b commit 73de295
Show file tree
Hide file tree
Showing 45 changed files with 194 additions and 184 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ media-logs: ## Show the logs for the media services (plex, sonarr, radarr, etc).

.PHONY: config-acme
config-acme: ## Initialize the acme.json file.
mkdir -p appdata/core/traefik/acme/
rm -f appdata/core/traefik/acme/acme.json
touch appdata/core/traefik/acme/acme.json
chmod 600 appdata/core/traefik/acme/acme.json
mkdir -p appdata/traefik/acme/
rm -f appdata/traefik/acme/acme.json
touch appdata/traefik/acme/acme.json
chmod 600 appdata/traefik/acme/acme.json

##@ Backup πŸ—‚οΈ

Expand Down
83 changes: 39 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,22 @@
## What is homelab?

**`homelab`** is a collection of services that can be deployed from your home server and accessed
securely from anywhere in the world. This project deploys multiple "stacks" of services:
securely from anywhere in the world. Ultimately everything is deployed into a single
docker compose application. Each service belongs to a [docker compose profile] - and the
`Makefile` contains everything you need to get started and manage your homelab.

- **`core`**: The `core` stack is the base of this project, it includes a [traefik] reverse proxy
- **`core`**: The `core` profile is the base of this project, it includes a [traefik] reverse proxy
and [OAuth] service that allows you to access all of your services via a single domain name
securely behind HTTPS and protected with Google OAuth.
- **`media`**: The `media` stack includes services like [Plex], [Sonarr], [Radarr], and
[Ombi] that allow you to request, download, organize, and stream media to your devices. This stack
- **`media`**: The `media` profile includes services like [Plex], [Sonarr], [Radarr], and
[Ombi] that allow you to request, download, organize, and stream media to your devices. This profile
is perfect for those who want to have a media server in their homelab.
- **`utilities`**: The `utilities` stack includes services like [Watchtower] and [Portainer] that
- **`utilities`**: The `utilities` profile includes services like [Watchtower] and [Portainer] that
are designed to help you manage your homelab, monitor your services,
and keep your containers up-to-date.
- **`miscellaneous`**: The `miscellaneous` stack is disabled by default.
- **`miscellaneous`**: The `miscellaneous` profile is disabled by default.
It includes services like [ChatGPT Next Web] and [LibreOffice Online]
that don't fit into the other stacks. These services are great for improving your
that don't fit into the other profiles. These services are great for improving your
productivity and adding some fun to your homelab.

## How does it work?
Expand All @@ -39,46 +41,38 @@ project that allows you to deploy a variety of services to your homelab.

At the root of this repository is a `docker-compose.yaml` file that defines
the entire homelab project - it uses the `include` directive to pull in
individual service docker compose files from the `stacks` directory.
Ultimately a single docker compose stack is created that deploys everything.
individual service docker compose files from the `apps` directory.

```text
.
β”œβ”€β”€ docker-compose.yaml # Main Docker Compose File
β”œβ”€β”€ .env # Environment Variables and Configuration
β”œβ”€β”€ Makefile # Makefile for common tasks and docker compose wrappers
β”œβ”€β”€ secrets # Secret Files
β”‚ β”œβ”€β”€ cloudflare_api_key.secret # Cloudflare API Key
β”‚ └── google_oauth.secret # Google OAuth Credentials and Whitelist
β”œβ”€β”€ stacks
β”‚ β”œβ”€β”€ media
β”‚ β”‚ β”œβ”€β”€ plex.yaml # Each individual service has its own docker compose file
β”‚ β”‚ β”œβ”€β”€ radarr.yaml
β”‚ | β”œβ”€β”€ ombi.yaml
β”‚ β”‚ └── sonarr.yaml
β”‚ β”œβ”€β”€ core # Traefik Reverse Proxy and OAuth
β”‚ β”‚ β”œβ”€β”€ oauth # OAuth Service
β”‚ β”‚ └── traefik # Traefik Reverse Proxy
β”‚ β”‚ β”œβ”€β”€ docker-compose.yaml # Traefik Docker Compose File (Traefik Only)
β”‚ β”‚ └── rules # Traefik Middlewares and Rules
β”‚ β”‚ β”œβ”€β”€ middlewares-chains.yml
β”‚ β”‚ β”œβ”€β”€ middlewares.yml
β”‚ β”‚ └── tls-opts.yml
β”‚ β”œβ”€β”€ miscellaneous # Non Media Center Services (pihole, chat-gpt-next-web, etc.)
β”‚ β”‚ └── chat-gpt-next-web.yaml
β”‚ └── utilities # Utility Services
β”‚ └── watchtower.yaml
└── appdata # Application Data Persistent Volumes
β”œβ”€β”€ media
β”‚ β”œβ”€β”€ plex # Each individual service has its own subdirectory
β”‚ └── sonarr
β”œβ”€β”€ core
β”‚ β”œβ”€β”€ oauth
β”‚ └── traefik
β”œβ”€β”€ miscellaneous
β”‚ └── chat-gpt-next-web
└── utilities
└── watchtower
β”œβ”€β”€ docker-compose.yaml # Main Docker Compose File
β”œβ”€β”€ .env # Environment Variables and Configuration
β”œβ”€β”€ Makefile # Makefile for common tasks and docker compose wrappers
β”œβ”€β”€ secrets # Secret Files
β”‚ β”œβ”€β”€ cloudflare_api_key.secret # Cloudflare API Key
β”‚ └── google_oauth.secret # Google OAuth Credentials and Whitelist
β”œβ”€β”€ apps # Individual Service Docker Compose Files
β”‚ β”œβ”€β”€ plex.yaml
β”‚ β”œβ”€β”€ radarr.yaml
β”‚ β”œβ”€β”€ ombi.yaml
β”‚ β”œβ”€β”€ sonarr.yaml
β”‚ β”œβ”€β”€ oauth.yaml
β”‚ β”œβ”€β”€ chat-gpt-next-web.yaml
β”‚ β”œβ”€β”€ watchtower.yaml
β”‚ └── traefik # Traefik Reverse Proxy
β”‚ β”œβ”€β”€ docker-compose.yaml # Traefik Docker Compose File
β”‚ └── rules # Traefik Middlewares and Rules
β”‚ β”œβ”€β”€ middlewares-chains.yml
β”‚ β”œβ”€β”€ middlewares.yml
β”‚ └── tls-opts.yml
└── appdata # Application Data Persistent Volumes
β”œβ”€β”€ plex # Each individual service has its own subdirectory
β”œβ”€β”€ sonarr
β”œβ”€β”€ oauth
β”œβ”€β”€ traefik
β”œβ”€β”€ chat-gpt-next-web
β”œβ”€β”€ utilities
└── watchtower
```

### Configuration
Expand All @@ -105,3 +99,4 @@ getting started.
[Watchtower]: https://github.com/containrrr/watchtower
[LibreOffice Online]: https://www.libreoffice.org/
[Portainer]: https://github.com/portainer/portainer
[docker compose profile]: https://docs.docker.com/compose/profiles/
2 changes: 1 addition & 1 deletion stacks/archive/nzbget.yaml β†’ apps/archive/nzbget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
image: lscr.io/linuxserver/nzbget:latest
profiles: ["media", "all"]
volumes:
- ${DOCKER_DIRECTORY}/appdata/media/nzbget:/config
- ${DOCKER_DIRECTORY}/appdata/nzbget:/config
- ${COMPLETED_DOWNLOADS}:/downloads/completed
environment:
PUID: ${PUID}
Expand Down
4 changes: 2 additions & 2 deletions stacks/media/calibre-web.yaml β†’ apps/calibre-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ services:
image: lscr.io/linuxserver/calibre-web:latest
profiles: ["media", "all"]
volumes:
- ${DOCKER_DIRECTORY}/appdata/media/calibre-web:/config
- ${DOCKER_DIRECTORY}/appdata/calibre-web:/config
- ${BOOKS_DIR}:/books
- ${DOCKER_DIRECTORY}/appdata/media/calibre:/calibre-config
- ${DOCKER_DIRECTORY}/appdata/calibre:/calibre-config
environment:
PUID: ${PUID}
PGID: ${PGID}
Expand Down
2 changes: 1 addition & 1 deletion stacks/media/calibre.yaml β†’ apps/calibre.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
image: lscr.io/linuxserver/calibre:latest
profiles: ["media", "all"]
volumes:
- ${DOCKER_DIRECTORY}/appdata/media/calibre:/config
- ${DOCKER_DIRECTORY}/appdata/calibre:/config
- ${BOOKS_DIR}:/books
- ${COMPLETED_DOWNLOADS}:/downloads
environment:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion stacks/media/heimdall.yaml β†’ apps/heimdall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
image: lscr.io/linuxserver/heimdall:latest
profiles: ["media", "all"]
volumes:
- ${DOCKER_DIRECTORY}/appdata/media/heimdall:/config
- ${DOCKER_DIRECTORY}/appdata/heimdall:/config
environment:
PUID: ${PUID}
PGID: ${PGID}
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ services:
image: homeassistant/home-assistant:stable
profiles: ["miscellaneous", "all"]
volumes:
- ${DOCKER_DIRECTORY}/stacks/miscellaneous/homeassistant/configuration.yaml:/config/configuration.yaml
- ${DOCKER_DIRECTORY}/appdata/miscellaneous/homeassistant:/config
- ${DOCKER_DIRECTORY}/apps/homeassistant/configuration.yaml:/config/configuration.yaml
- ${DOCKER_DIRECTORY}/appdata/homeassistant:/config
environment:
PUID: ${PUID}
PGID: ${PGID}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ services:
- PGID=${PGID}
- TZ=${TZ}
volumes:
- ${DOCKER_DIRECTORY}/appdata/miscellaneous/libreoffice:/config
- ${DOCKER_DIRECTORY}/appdata/libreoffice:/config
security_opt:
- no-new-privileges:true
networks:
Expand Down
2 changes: 1 addition & 1 deletion stacks/media/nzbhydra.yaml β†’ apps/nzbhydra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
image: lscr.io/linuxserver/nzbhydra2:latest
profiles: ["media", "all"]
volumes:
- ${DOCKER_DIRECTORY}/appdata/media/nzbhydra:/config
- ${DOCKER_DIRECTORY}/appdata/nzbhydra:/config
- ${COMPLETED_DOWNLOADS}:/downloads
environment:
PUID: ${PUID}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion stacks/media/ombi.yaml β†’ apps/ombi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
PGID: ${PGID}
TZ: ${TZ}
volumes:
- ${DOCKER_DIRECTORY}/appdata/media/ombi:/config
- ${DOCKER_DIRECTORY}/appdata/ombi:/config
security_opt:
- no-new-privileges:true
restart: ${UNIVERSAL_RESTART_POLICY:-unless-stopped}
Expand Down
4 changes: 2 additions & 2 deletions stacks/utilities/pihole.yaml β†’ apps/pihole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ services:
DNS2: 8.8.4.4
VIRTUAL_HOST: ${PIHOLE_SUBDOMAIN:-pihole}.${DOMAIN_NAME}
volumes:
- ${DOCKER_DIRECTORY}/appdata/utilities/pihole/pihole/:/etc/pihole/
- ${DOCKER_DIRECTORY}/appdata/utilities/pihole/dnsmasq.d/:/etc/dnsmasq.d/
- ${DOCKER_DIRECTORY}/appdata/pihole/pihole/:/etc/pihole/
- ${DOCKER_DIRECTORY}/appdata/pihole/dnsmasq.d/:/etc/dnsmasq.d/
networks:
traefik:
ports:
Expand Down
3 changes: 1 addition & 2 deletions stacks/media/plex.yaml β†’ apps/plex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ services:
profiles: ["media", "all"]
network_mode: host
volumes:
- ${DOCKER_DIRECTORY}/appdata/media/plex:/config
- ${DOCKER_DIRECTORY}/appdata/plex:/config
- ${TV_DIR}:/tv
- ${MOVIE_DIR}:/movies
- ${DOCKER_DIRECTORY}/stacks/media/shared:/shared
- ${PLEX_TRANSCODE_DIR:-/tmp}:/transcode
- ${BOOKS_DIR}:/books
devices:
Expand Down
3 changes: 1 addition & 2 deletions stacks/utilities/portainer.yaml β†’ apps/portainer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ services:
image: portainer/portainer-ce:latest
profiles: ["utilities", "all"]
volumes:
- ${DOCKER_DIRECTORY}/appdata/utilities/portainer:/data
- ${DOCKER_DIRECTORY}/stacks/utilities/shared:/shared
- ${DOCKER_DIRECTORY}/appdata/portainer:/data
command: -H tcp://socket-proxy:2375
environment:
TZ: ${TZ}
Expand Down
2 changes: 1 addition & 1 deletion stacks/utilities/postgres.yaml β†’ apps/postgres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
networks:
internal:
volumes:
- ${DOCKER_DIRECTORY}/appdata/utilities/homelab-postgres:/var/lib/postgresql/data
- ${DOCKER_DIRECTORY}/appdata/homelab-postgres:/var/lib/postgresql/data
- ${DOCKER_DIRECTORY}/scripts/create-databases.sh:/docker-entrypoint-initdb.d/create-databases.sh
restart: always
healthcheck:
Expand Down
2 changes: 1 addition & 1 deletion stacks/media/prowlarr.yaml β†’ apps/prowlarr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
image: lscr.io/linuxserver/prowlarr:develop
profiles: ["media", "arrs", "all"]
volumes:
- ${DOCKER_DIRECTORY}/appdata/media/prowlarr:/config
- ${DOCKER_DIRECTORY}/appdata/prowlarr:/config
environment:
PUID: ${PUID}
PGID: ${PGID}
Expand Down
3 changes: 1 addition & 2 deletions stacks/media/radarr.yaml β†’ apps/radarr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ services:
image: lscr.io/linuxserver/radarr:latest
profiles: ["media", "arrs", "all"]
volumes:
- ${DOCKER_DIRECTORY}/appdata/media/radarr:/config
- ${DOCKER_DIRECTORY}/appdata/radarr:/config
- ${COMPLETED_DOWNLOADS}:/downloads
- ${MOVIE_DIR}:/movies
- ${DOCKER_DIRECTORY}/stacks/media/shared:/shared
environment:
PUID: ${PUID}
PGID: ${PGID}
Expand Down
4 changes: 2 additions & 2 deletions stacks/media/readarr.yaml β†’ apps/readarr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ services:
image: lscr.io/linuxserver/readarr:develop
profiles: ["media", "arrs", "all"]
volumes:
- ${DOCKER_DIRECTORY}/appdata/media/readarr:/config
- ${DOCKER_DIRECTORY}/appdata/readarr:/config
- ${COMPLETED_DOWNLOADS}:/downloads
- ${BOOKS_DIR}:/books
- ${DOCKER_DIRECTORY}/appdata/media/calibre:/calibre
- ${DOCKER_DIRECTORY}/appdata/calibre:/calibre
environment:
PUID: ${PUID}
PGID: ${PGID}
Expand Down
2 changes: 1 addition & 1 deletion stacks/media/sabnzbd.yaml β†’ apps/sabnzbd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
image: lscr.io/linuxserver/sabnzbd:latest
profiles: ["media", "all"]
volumes:
- ${DOCKER_DIRECTORY}/appdata/media/sabnzbd:/config
- ${DOCKER_DIRECTORY}/appdata/sabnzbd:/config
- ${COMPLETED_DOWNLOADS}:/downloads
- ${INCOMPLETE_DOWNLOADS}:/incomplete-downloads
environment:
Expand Down
4 changes: 2 additions & 2 deletions stacks/utilities/sftpgo.yaml β†’ apps/sftpgo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ services:
- ${MOVIE_DIR}:/srv/sftpgo/data/juftin/movies
- ${TV_DIR}:/srv/sftpgo/data/juftin/tv
- ${BOOKS_DIR}:/srv/sftpgo/data/juftin/books
- ${DOCKER_DIRECTORY}/appdata/utilities/sftpgo/data/:/srv/sftpgo/data/juftin/upload
- ${DOCKER_DIRECTORY}/appdata/utilities/sftpgo/config/:/var/lib/sftpgo/
- ${DOCKER_DIRECTORY}/appdata/sftpgo/data/:/srv/sftpgo/data/juftin/upload
- ${DOCKER_DIRECTORY}/appdata/sftpgo/config/:/var/lib/sftpgo/
environment:
PUID: ${PUID}
PGID: ${PGID}
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions stacks/media/sonarr.yaml β†’ apps/sonarr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ services:
image: lscr.io/linuxserver/sonarr:latest
profiles: ["media", "arrs", "all"]
volumes:
- ${DOCKER_DIRECTORY}/appdata/media/sonarr:/config
- ${DOCKER_DIRECTORY}/appdata/sonarr:/config
- ${COMPLETED_DOWNLOADS}:/downloads
- ${TV_DIR}:/tv
- ${DOCKER_DIRECTORY}/stacks/media/shared:/shared
environment:
PUID: ${PUID}
PGID: ${PGID}
Expand Down
5 changes: 2 additions & 3 deletions stacks/media/tautulli.yaml β†’ apps/tautulli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ services:
image: lscr.io/linuxserver/tautulli:latest
profiles: ["media", "all"]
volumes:
- ${DOCKER_DIRECTORY}/appdata/media/tautulli:/config
- ${DOCKER_DIRECTORY}/appdata/media/plex/Library/Application Support/Plex Media Server/Logs:/logs:ro
- ${DOCKER_DIRECTORY}/stacks/media/shared:/shared
- ${DOCKER_DIRECTORY}/appdata/tautulli:/config
- ${DOCKER_DIRECTORY}/appdata/plex/Library/Application Support/Plex Media Server/Logs:/logs:ro
environment:
PUID: ${PUID}
PGID: ${PGID}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ services:
- source: cloudflare_api_key
target: /run/secrets/cloudflare_api_key
volumes:
- ${DOCKER_DIRECTORY}/stacks/core/traefik/rules:/rules
- ${DOCKER_DIRECTORY}/appdata/core/traefik/logs:/logs
- ${DOCKER_DIRECTORY}/appdata/core/traefik/traefik:/etc/traefik
- ${DOCKER_DIRECTORY}/appdata/core/traefik/acme/acme.json:/acme.json
- ${DOCKER_DIRECTORY}/apps/traefik/rules:/rules
- ${DOCKER_DIRECTORY}/appdata/traefik/logs:/logs
- ${DOCKER_DIRECTORY}/appdata/traefik/traefik:/etc/traefik
- ${DOCKER_DIRECTORY}/appdata/traefik/acme/acme.json:/acme.json
networks:
traefik:
docker:
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions stacks/media/transmission.yaml β†’ apps/transmission.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ services:
profiles: ["media", "all"]
volumes:
- /etc/localtime:/etc/localtime:ro
- ${DOCKER_DIRECTORY}/appdata/media/transmission:/config/transmission-home
- ${DOCKER_DIRECTORY}/appdata/transmission:/config/transmission-home
- ${COMPLETED_DOWNLOADS}:/downloads
- ${INCOMPLETE_DOWNLOADS}:/data/incomplete
- ${DOCKER_DIRECTORY}/stacks/media/shared:/shared
environment:
PUID: ${PUID}
PGID: ${PGID}
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 73de295

Please sign in to comment.