feat: plex setup (#1)
This commit is contained in:
parent
b783b80e2a
commit
0f990efd86
6 changed files with 78 additions and 1 deletions
|
@ -1 +1,7 @@
|
|||
# spadinaistan
|
||||
# spadinaistan
|
||||
|
||||
## Services
|
||||
|
||||
|Service|Description|
|
||||
|---|---|
|
||||
|[Plex](./plex)|Plex media server|
|
||||
|
|
4
plex/.gitignore
vendored
Normal file
4
plex/.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
*.env
|
||||
media/**/*
|
||||
transcode/**/*
|
||||
database/**/*
|
18
plex/README.md
Normal file
18
plex/README.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Plex
|
||||
|
||||
## Setup
|
||||
|
||||
*Requires `docker-compose`*
|
||||
|
||||
Run `. script/bootstrap` to check that `docker-compose` is available and to create the required directory structure.
|
||||
|
||||
Run `. script/start` to start the service.
|
||||
|
||||
### First setup only
|
||||
|
||||
Make sure to create a `plex.env` file containing:
|
||||
|
||||
|Environment variable|Description|
|
||||
|---|---|
|
||||
|`ADVERTISE_IP`|Full address and port of the network entry point to advertise for Plex.|
|
||||
|`PLEX_CLAIM`|Claim ID required to link the server to a Plex account|
|
25
plex/docker-compose.yml
Normal file
25
plex/docker-compose.yml
Normal file
|
@ -0,0 +1,25 @@
|
|||
version: '3.7'
|
||||
services:
|
||||
plex:
|
||||
image: plexinc/pms-docker:1.27.2.5929-a806c5905
|
||||
restart: always
|
||||
container_name: plex-server
|
||||
hostname: plexserver.spadinaistan.local
|
||||
ports:
|
||||
- "32400:32400/tcp"
|
||||
- "32469:32469/tcp"
|
||||
- "3005:3005/tcp"
|
||||
- "8324:8324/tcp"
|
||||
- "1900:1900/udp"
|
||||
- "32410:32410/udp"
|
||||
- "32412:32412/udp"
|
||||
- "32413:32413/udp"
|
||||
- "32414:32414/udp"
|
||||
env_file:
|
||||
- plex.env
|
||||
environment:
|
||||
- TZ=America/Toronto
|
||||
volumes:
|
||||
- ./database:/config
|
||||
- ./transcode:/transcode
|
||||
- ./media:/data
|
21
plex/script/bootstrap
Normal file
21
plex/script/bootstrap
Normal file
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Bootstrap for Plex
|
||||
#
|
||||
# Verifies that docker-compose is available and that the required directories
|
||||
# are present.
|
||||
|
||||
if ! [ -x "$(command -v docker-compose)" ]; then
|
||||
echo "👎 docker-compose isn't available but is required."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "✅ docker-compose $(docker-compose version --short) found."
|
||||
|
||||
# Required directory structure, these will be mapped to locations in the Plex
|
||||
# container.
|
||||
|
||||
mkdir ./{media,database,transcode} -vp
|
||||
|
||||
echo "✅ directory structure ready"
|
||||
echo "✨ Good to go ✨"
|
3
plex/script/start
Normal file
3
plex/script/start
Normal file
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
sudo docker-compose up -d
|
Reference in a new issue