diff --git a/services/immich/.env b/services/immich/.env index c683e938..aab430db 100644 --- a/services/immich/.env +++ b/services/immich/.env @@ -23,10 +23,10 @@ TZ=Europe/Amsterdam # See: https://en.wikipedia.org/wiki/List_of_tz_database_tim # PUID=1000 # The location where your uploaded files are stored -UPLOAD_LOCATION=./library +UPLOAD_LOCATION=./${SERVICE}-data/upload # The location where your database files are stored. Network shares are not supported for the database -DB_DATA_LOCATION=./postgres +DB_DATA_LOCATION=./${SERVICE}-data/database # To set a timezone, change the TZ value above to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List diff --git a/services/immich/README.md b/services/immich/README.md index d2f81a5c..1bb9a1cc 100644 --- a/services/immich/README.md +++ b/services/immich/README.md @@ -25,4 +25,6 @@ In this deployment, the `tailscale-immich` service runs the Tailscale client to * **Keep `TS_ACCEPT_DNS` disabled.** The `application` service shares the DNS configuration of the `tailscale` service. With `TS_ACCEPT_DNS=true`, Tailscale replaces Docker's DNS with MagicDNS, which cannot resolve the `database`, `redis`, and `immich-machine-learning` services. Immich then fails to start with `getaddrinfo ENOTFOUND database`. You can reach Immich over your Tailnet without this setting. * **Resolving MagicDNS names from Immich.** If Immich itself must look up other Tailnet devices by name, such as an OAuth provider or SMTP server, uncomment the `dns` block of the `tailscale` service and set `100.100.100.100` as the DNS server. Docker keeps resolving the service names and forwards all other lookups to MagicDNS. Use the full name, such as `device.example.ts.net`. +* **Storage locations.** `UPLOAD_LOCATION` and `DB_DATA_LOCATION` in `.env` set where Immich stores your media and its database. The defaults are `./immich-data/upload` and `./immich-data/database`. To move your media to another disk, set `UPLOAD_LOCATION` to an absolute path. Keep the database on a local disk, because Immich does not support network shares for it. +* **Updating an existing installation.** Earlier versions of this stack ignored both variables and always used the default folders. If your `.env` still contains `UPLOAD_LOCATION=./library` or `DB_DATA_LOCATION=./postgres`, replace them with the defaults above before you restart. Otherwise Immich starts with an empty library and a new database. Your existing files stay untouched in `./immich-data`. * **Renamed services.** Immich connects to the hostnames `database` and `redis` by default. If you rename these services in `compose.yaml`, set `DB_HOSTNAME` and `REDIS_HOSTNAME` in `.env` to the new names. diff --git a/services/immich/compose.yaml b/services/immich/compose.yaml index 9a4800fa..5ef15283 100644 --- a/services/immich/compose.yaml +++ b/services/immich/compose.yaml @@ -58,7 +58,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 - - ./${SERVICE}-data/upload:/data + - ${UPLOAD_LOCATION}:/data - /etc/localtime:/etc/localtime:ro env_file: - .env @@ -106,7 +106,7 @@ services: # DB_STORAGE_TYPE: 'HDD' 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 - - ./${SERVICE}-data/database:/var/lib/postgresql/data + - ${DB_DATA_LOCATION}:/var/lib/postgresql/data # Healthcheck: defined by the image (/usr/local/bin/healthcheck.sh), so this file does not override it. # The image's check connects over the Unix socket, so it can report ready during first-start initialization. restart: always