Skip to content

Instantly share code, notes, and snippets.

@castrojo
Created June 2, 2020 15:14
Show Gist options
  • Save castrojo/b871f63e4b545509342dc25df4f9e3ef to your computer and use it in GitHub Desktop.
Save castrojo/b871f63e4b545509342dc25df4f9e3ef to your computer and use it in GitHub Desktop.
% cat /etc/systemd/system/plexmediaserver.service
[Unit]
Description=Plex Media Server
Requires=docker.service
After=network.target irontower.mount docker.service
[Service]
Slice=machine.slice
Type=simple
Environment="ADVERTISE_IP=http://192.168.1.101:32400"
ExecStartPre=/bin/chmod -R 777 /dev/dri
ExecStart=/usr/bin/docker run --net=host --name=plexmediaserver -e PUID=1000 -e PGID=1000 -v /home/jorge/config/plexmediaserver:/config --device /dev/dri/card0:/dev/dri/card0 -v /storage/TV:/storage/TV -v /storage/Movies:/storage/Movies -v /storage/Popular:/storage/Popular -v /storage/YouTube:/storage/YouTube -v /storage/Kids:/storage/Kids --device /dev/dri/renderD128:/dev/dri/renderD128 plexinc/pms-docker
ExecStop=/usr/bin/docker stop -t 2 plexmediaserver
ExecStopPost=/usr/bin/docker rm -f plexmediaserver
KillMode=mixed
Restart=always
RestartSec=60
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment