From 81c27e49885d3ca865ffc808eab3d11f90acda41 Mon Sep 17 00:00:00 2001 From: Michael Housh Date: Wed, 19 Mar 2025 22:59:29 -0400 Subject: [PATCH] feat: Initial nfs setup. --- compose.yml | 24 +++++++++++++++++++++--- example.env | 4 +--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/compose.yml b/compose.yml index 26a4403..ce9d9ce 100644 --- a/compose.yml +++ b/compose.yml @@ -18,7 +18,7 @@ services: # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding volumes: # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file - - ${UPLOAD_LOCATION}:/usr/src/app/upload + - immich-uploads:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro env_file: - .env @@ -64,7 +64,7 @@ services: POSTGRES_INITDB_ARGS: '--data-checksums' volumes: # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file - - ${DB_DATA_LOCATION}:/var/lib/postgresql/data + - immich-database:/var/lib/postgresql/data healthcheck: test: >- pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1; @@ -86,4 +86,22 @@ services: restart: unless-stopped volumes: - model-cache: + model-cache: {} + + immich-uploads: + driver: local + driver_opts: + type: nfs + o: "addr=${NFS_URL},soft,nolock,rw" + device: "${UPLOAD_LOCATION}" + labels: + dev.housh.description: "Immich upload volume." + + immich-database: + driver: local + # driver_opts: + # type: nfs + # o: "addr=${NFS_URL},soft,nolock,rw" + # device: "${DB_DATA_LOCATION}" + labels: + dev.housh.description: "Immich database volume." diff --git a/example.env b/example.env index c64ca2f..a02acd6 100644 --- a/example.env +++ b/example.env @@ -1,9 +1,7 @@ # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored -UPLOAD_LOCATION=/media/immich/library -# The location where your database files are stored -DB_DATA_LOCATION=/media/immich/db +UPLOAD_LOCATION=":/var/nfs/path/to/photo/library" # To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List # TZ=Etc/UTC