immich NFS - Proxmox
I have a Proxmox cluster with three hosts. One of them has Debian with Docker installed, and all my containers, including immich, are running there.
My storage (NAS) is on a dedicated server, and the folders are shared via NFS.
Currently, I have both existing photos (in the external library) and new uploads configured to be uploaded/saved to this shared storage. The problem is that thumbnails, ML cache, encoded video, etc., are also stored there, which slows things down.
What's the best practice for uploading and storing new images on this Unraid shared storage? And what should be running locally on the Docker machine?
Compose:
name: immich
services:
immich-server:
container_name: immich-server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
restart: unless-stopped
env_file:
- .env
environment:
TZ: ${TZ}
DB_HOSTNAME: immich-database
DB_PORT: 5432
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
DB_DATABASE_NAME: ${DB_DATABASE_NAME}
REDIS_HOSTNAME: immich-redis
REDIS_PORT: 6379
UPLOAD_LOCATION: /usr/src/app/upload
volumes:
- immich_upload:/usr/src/app/upload
- immich_library:/mnt/library:ro
- ${IMMICH_BACKUPS_LOCATION}:usr/src/app/upload/backups
- ${IMMICH_THUMBS_LOCATION}:/usr/src/app/upload/thumbs
- ${IMMICH_ENCODED_LOCATION}:/usr/src/app/upload/encoded-video
- ${IMMICH_PROFILE_LOCATION}:/usr/src/app/upload/profile
- ${IMMICH_CACHE_LOCATION}:/cache
- /etc/localtime:/etc/localtime:ro
networks:
- internal
- external
depends_on:
immich-redis:
condition: service_healthy
immich-database:
condition: service_healthy
security_opt:
- no-new-privileges:true
immich-machine-learning:
container_name: immich-machine-learning
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
restart: unless-stopped
env_file:
- .env
environment:
TZ: ${TZ}
volumes:
- ${IMMICH_ML_CACHE_LOCATION}:/cache
- /etc/localtime:/etc/localtime:ro
networks:
- internal
security_opt:
- no-new-privileges:true
immich-redis:
container_name: immich-redis
image: redis:7-alpine
restart: unless-stopped
command: redis-server --maxmemory 512mb --maxmemory-policy allkeys-lru
networks:
- internal
healthcheck:
test:
- CMD
- redis-cli
- ping
interval: 10s
timeout: 5s
retries: 10
immich-database:
container_name: immich-database
image: tensorchord/pgvecto-rs:pg14-v0.2.0
restart: unless-stopped
environment:
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE_NAME}
TZ: ${TZ}
volumes:
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro
networks:
- internal
healthcheck:
test:
- CMD-SHELL
- pg_isready -U ${DB_USERNAME} -d ${DB_DATABASE_NAME}
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
networks:
internal:
name: immich_internal
internal: true
external:
name: npm_network
external: true
volumes:
immich_upload:
driver: local
driver_opts:
type: nfs
o: addr=10.110.10.10,rw,nfsvers=4.2,tcp,hard,timeo=600,rsize=1048576,wsize=1048576,noatime,nconnect=8
device: :/mnt/user/photos/upload
immich_library:
driver: local
driver_opts:
type: nfs
o: addr=10.110.10.10,ro,nfsvers=4.2,tcp,hard,timeo=600,rsize=1048576,wsize=1048576,noatime,nconnect=8
device: :/mnt/user/photos/library
.env file:
TZ=Europe/Europe
IMMICH_VERSION=release
DB_USERNAME=postgres
DB_PASSWORD=xxxxxxxxxxxx
DB_DATABASE_NAME=immich
DB_DATA_LOCATION=/opt/stacks/immich/postgres
IMMICH_CACHE_LOCATION=/opt/stacks/immich/cache
IMMICH_ML_CACHE_LOCATION=/opt/stacks/immich/ml-cache
IMMICH_THUMBS_LOCATION=/opt/stacks/immich/thumbs
IMMICH_ENCODED_LOCATION=/opt/stacks/immich/encoded-video
IMMICH_PROFILE_LOCATION=/opt/stacks/immich/profile
IMMICH_BACKUPS_LOCATION=/opt/stacks/immich/backups
Thanks in advance.