a_skeleton_03
<Banned>
- 29,948
- 29,765
So I swapped all of my home server applications to docker a little while back and am finally going to write up what I did for those interested in it. It is super easy to work with and so easy to manage long term.
1.) What is docker
2.) File structure
3.) Necessary tools
4.) Config files
Docker
So I am going to give you the basics of what docker is as I understand and use it. There are better sites out there you could get a deeper level of information from if you want to but for the purposes of this thread you will understand the basics of it.
So docker is a framework that allows you to take an application or group of them and expose their data and traffic to the OS but only at a basic level. Think of it like a virtual machine without all the overhead. Everything is contained in the ... container of the docker and docker itself talks to the OS and then back to the container passing just what each side needs. It keeps things really clean when it comes to dependencies that might not be compatible. You remember when you used to have different autoexec.bat files for gaming? It is sort of like that.
There is a little bit of hands off what is in the container and some level of trust with the developer just like any other application. That being said you could build your own so you know exactly what is inside it. I do not but I use trusted containers from known places.
File structure
So I run linux as my server but the beauty of this is you can do this on windows or mac osx as well. You need a place for all of the containers to expose their config files to so you can edit them. You also need to choose how you expose your file structure over to the containers. One of the benefits is you can expose only certain folders and also map new folder names to the container.
I have all of my config files in /opt/docker/ and then a folder for each container. I have all of my exposed files in /library/ and it's mostly media so folders like /library/movies /library/tv etc etc
Necessary Tools
Personally I only use docker compose and docker but there are a ton of tools for automation and web interfaces. Instead of using nginx or some other webserver in a docker that is something I run as part of the OS. If you are not running linux then it would be quite useful to run the webserver in docker for ease of use.
Get Docker CE for Ubuntu
Install Docker for Windows
Get started with Docker for Mac
Those are the official install instructions from docker and it's pretty easy to get running. Once you get that up and running that is all you actually need. For Docker Compose you only need to do something to install it on linux because it's default installed for windows/mac osx.
Install Docker Compose
Compose is super awesome because it allows you to create a yml file that lists all your dockers and what they have access to and you can bring them all down and up within seconds. This allows me to spin up an entirely new server in about 5 minutes max. Copy the docker compose file, download the backup of the containers config folders, install docker, install compose, tell it to run the compose file, and done.
Here is my compose file.
1.) What is docker
2.) File structure
3.) Necessary tools
4.) Config files
Docker
So I am going to give you the basics of what docker is as I understand and use it. There are better sites out there you could get a deeper level of information from if you want to but for the purposes of this thread you will understand the basics of it.
So docker is a framework that allows you to take an application or group of them and expose their data and traffic to the OS but only at a basic level. Think of it like a virtual machine without all the overhead. Everything is contained in the ... container of the docker and docker itself talks to the OS and then back to the container passing just what each side needs. It keeps things really clean when it comes to dependencies that might not be compatible. You remember when you used to have different autoexec.bat files for gaming? It is sort of like that.
There is a little bit of hands off what is in the container and some level of trust with the developer just like any other application. That being said you could build your own so you know exactly what is inside it. I do not but I use trusted containers from known places.
File structure
So I run linux as my server but the beauty of this is you can do this on windows or mac osx as well. You need a place for all of the containers to expose their config files to so you can edit them. You also need to choose how you expose your file structure over to the containers. One of the benefits is you can expose only certain folders and also map new folder names to the container.
I have all of my config files in /opt/docker/ and then a folder for each container. I have all of my exposed files in /library/ and it's mostly media so folders like /library/movies /library/tv etc etc
Necessary Tools
Personally I only use docker compose and docker but there are a ton of tools for automation and web interfaces. Instead of using nginx or some other webserver in a docker that is something I run as part of the OS. If you are not running linux then it would be quite useful to run the webserver in docker for ease of use.
Get Docker CE for Ubuntu
Install Docker for Windows
Get started with Docker for Mac
Those are the official install instructions from docker and it's pretty easy to get running. Once you get that up and running that is all you actually need. For Docker Compose you only need to do something to install it on linux because it's default installed for windows/mac osx.
Install Docker Compose
Compose is super awesome because it allows you to create a yml file that lists all your dockers and what they have access to and you can bring them all down and up within seconds. This allows me to spin up an entirely new server in about 5 minutes max. Copy the docker compose file, download the backup of the containers config folders, install docker, install compose, tell it to run the compose file, and done.
Here is my compose file.
YAML:
---
version: '2'
services:
plex:
image: linuxserver/plex:latest
container_name: plex
volumes:
- /opt/plex:/config
- /library:/data
network_mode: host
restart: always
environment:
- CLAIM="PJVO7UTP3YPJVCQJUYPJ"
- VERSION=latest
- PUID=1000
- PGID=1000
- TZ=America\New_York
emby:
image: emby/embyserver:latest
container_name: emby
volumes:
- /opt/emby:/config
- /library:/data
ports:
- 8000:8096
restart: always
environment:
- APP_UID=1000
- APP_GID=1000
- TZ=America\New_York
tautulli:
image: shiggins8/tautulli
container_name: tautulli
depends_on:
- plex
volumes:
- /opt/plexpy:/config
- /opt/plexpy/logs:/logs:ro
ports:
- 8181:8181
links:
- plex
restart: always
environment:
- PUID=1000
- PGID=1000
sonarr:
image: linuxserver/sonarr
container_name: sonarr
volumes:
- /opt/sonarr:/config
- /library/tv:/tv
- /home/a_skeleton_03/Downloads:/downloads
ports:
- 8989:8989
links:
- jackett
restart: always
environment:
- PUID=1000
- PGID=1000
radarr:
image: linuxserver/radarr
container_name: radarr
volumes:
- /opt/radarr:/config
- /library/movies:/movies
- /home/a_skeleton_03/Downloads:/downloads
ports:
- 7878:7878
links:
- jackett
environment:
- PUID=1000
- PGID=1000
restart: always
jackett:
image: linuxserver/jackett
container_name: jackett
volumes:
- /opt/jackett/config:/config
- /opt/jackett/downloads:/downloads
ports:
- 9117:9117
environment:
- PUID=1000
- PGID=1000
- TZ=America\New_York
restart: always
calibre:
image: linuxserver/calibre-web
container_name: calibre
ports:
- 8083:8083
volumes:
- /opt/calibre/config:/config
- /library/books:/books
environment:
- PUID=1000
- PGID=1000
- TZ=America\New_York
restart: always
ombi:
image: linuxserver/ombi
container_name: ombi
ports:
- 3579:3579
volumes:
- /opt/ombi:/config
- /etc/localtime:/etc/localtime:ro
environment:
- PUID=1000
- PGID=1000
- TZ=America\New_York
restart: always
influxdb:
image: influxdb:latest
container_name: influxdb
ports:
- 8085:8083
- 8086:8086
- 8090:8090
volumes:
- /opt/influxdb:/var/lib/influxdb
env_file:
- env.influx
restart: always
telegraf:
image: telegraf:latest
container_name: telegraf
links:
- influxdb
volumes:
- /opt/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- PUID=1000
- PGID=1000
- TZ=America\New_York
restart: always
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- 3000:3000
links:
- influxdb
env_file:
- env.grafana
restart: always
rutorrent:
image: linuxserver/rutorrent
container_name: rutorrent
ports:
- 8087:80
- 5000:5000
- 51413:51413
- 6881:6881
volumes:
- /opt/rutorrent:/config
- /home/a_skeleton_03/Downloads:/downloads
environment:
- PUID=1000
- PGID=1000
- TZ=America\New_York
restart: always
gazee:
image: hubcapps/docker-gazee
container_name: gazee
ports:
- 4242:4242
volumes:
- /library/comics:/comics
- /opt/gazee:/config
environment:
- PUID=1000
- PGID=1000
- TZ=America\New_York
restart: always
- 6