From 3b4dbbc51200e6c41555fe093ddd00cacc892704 Mon Sep 17 00:00:00 2001 From: Tanguy Herbron Date: Thu, 24 Jun 2021 15:09:04 +0200 Subject: [PATCH] Add NFS configuration and documentation --- README.md | 24 ++++++++++++++++++++++++ docker-compose.yml | 20 +++++++++++++++++--- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d59818f..1bf9f10 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/docker-compose.yml b/docker-compose.yml index 8ee9913..66a3c0d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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"