Add NFS configuration and documentation

This commit is contained in:
Tanguy Herbron 2021-06-24 15:09:04 +02:00
parent da0dff9f1e
commit 3b4dbbc512
2 changed files with 41 additions and 3 deletions

View File

@ -15,3 +15,27 @@ docker-compose up -d
```
All necessary images should be downloaded automatically and the service should be started in the background.
## Start on boot
If you want to use NFS volumes mounted directly inside the container, it is highly recommended to use `systemd` to start the service on boot.
```
[Unit]
Description=Start jellyfin server through docker
After=docker.service network-online.target
Requires=docker.service network-online.target
[Service]
WorkingDirectory=/opt/services/Jellyfin
Type=oneshot
RemainAfterExit=yes
ExecStartPre=/usr/bin/sleep 10
ExecStart=/usr/local/bin/docker-compose up -d
ExecStop=/usr/local/bin/docker-compose stop
[Install]
WantedBy=multi-user.target
```
Notice the `sleep` of 10 seconds, it seems like starting the process straight after boot fails because of some NFS confusion, adding a timer fixes the problem until a better solution is found.

View File

@ -9,12 +9,26 @@ services:
- PGID=1000
- TZ=Europe/Copenhagen
volumes:
- /media/alpha/jellyfin/config:/config
- /media/alpha/jellyfin/tvshows:/data/tvshows
- /media/alpha/jellyfin/movies:/data/movies
- ./config:/config
- tvshows:/data/tvshows
- movies:/data/movies
ports:
- 8096:8096
- 8920:8920
- 7359:7359/udp
- 1900:1900/udp
restart: unless-stopped
volumes:
movies:
driver: local
driver_opts:
type: nfs
o: addr=10.10.0.12,nolock,soft,rw
device: ":/export/movies"
tvshows:
driver: local
driver_opts:
type: nfs
o: addr=10.10.0.12,nolock,soft,rw
device: ":/export/tv_shows"