Di seguito trovate le indicazioni per installare Immich sul Qnap tramite Container Station.
Io ho seguito la guida presente al seguente link effettuando alcune modifiche:
https://blog.jjk1.de/index.php/2024/06/ ... tallieren/
Dopo aver scaricato i file example.env e docker-compose.yml li ho modificati nel seguente modo con un edito di testo (al momento non salvateli perché è sufficiente copiare e incollare il contenuto):
echo "# 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=/share/Container/immich/library
# The location where your database files are stored
DB_DATA_LOCATION=/share/Container/immich/postgres
# 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_t ... zones#List
# TZ=Etc/UTC
TZ=Europe/Rome
# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release
# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=AbCdEfGh1234
# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich" > .env
Ho inserito echo “...” >.env per poter creare il file tramite linea di comando ssh (ssh admin@<ipNAS> ex: ssh admin@192.156.1.200 ) come specificato nella guida riportata sul sito
Nella riga DB_PASSWORD=AbCdEfGh1234 sostituite la stringa AbCdEfGh1234 con una password (evitate il carattere $)
Il File docker-compose.yml dovrebbe essere simile al seguente, quando ho aggiornato l'applicazione ho dovuto eliminare la prima riga (version: '3').
Controllate tutti i percorsi e le variabili (POSTGRES_PASSWORD: AbCdEfGh1234):
#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
#
https://github.com/immich-app/immich/re ... ompose.yml
#
# The compose file on main may not be compatible with the latest release.
#
version: '3'
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:release
# extends:
# file: hwaccel.transcoding.yml
# 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
- /share/Container/immich/library:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
ports:
- '2283:2283'
depends_on:
- redis
- database
restart: always
healthcheck:
disable: false
immich-machine-learning:
container_name: immich_machine_learning
# For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
# Example tag: ${IMMICH_VERSION:-release}-cuda
image: ghcr.io/immich-app/immich-machine-learning:release
# extends: # uncomment this section for hardware acceleration - see
https://immich.app/docs/features/ml-har ... celeration
# file: hwaccel.ml.yml
# service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
healthcheck:
disable: false
redis:
container_name: immich_redis
image: docker.io/redis:6.2-alpine@sha256:2ba50e1ac3a0ea17b736ce9db2b0a9f6f8b85d4c27d5f5accc6a416d8f42c6d5
healthcheck:
test: redis-cli ping || exit 1
restart: always
database:
container_name: immich_postgres
image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
environment:
POSTGRES_PASSWORD: AbCdEfGh1234
POSTGRES_USER: postgres
POSTGRES_DB: immich
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
- /share/Container/immich/postgres:/var/lib/postgresql/data
healthcheck:
interval: 5m
start_interval: 30s
start_period: 5m
restart: always
volumes:
model-cache:
Come descritto nella guida ho creato il file .env inizialmente nella cartella /tmp
e successivamente in /share/Container/container-station-data/application/immich
Aprire Container Station e posizionarsi su Application (seconda voce a sx) e cliccare sul tasto +Create per creare una nuova applicazione.
Copiare il contenuto del file docker-compose.yml e premete il pulsante validate. Se tutto va bene cliccate sul pulsante Create.
Se durante la creazione dovesse andare in errore, tramite ssh create il file .env nella cartella /share/Container/container-station-data/application/immich e riprovate a creare l'applicazione.
Dopo alcuni minuti l'applicazione sarà raggiungibile all'indirizzo ip del NAS seguito dalla porta 2283:
Eempio:
http://192.156.1.200:2283
In questo modo sarete in grado di accedere a Immich dalla vostra rete domestica.
Per poter esporre il servizio in internet è possibile configurare un port forward sul vostro router (attenzione!!!) o implementare un reverse proxy.
Per fare questo potete configuare Caddy sempre su Docker o più semplicemente usare il reverse proxy del QNAP. Nel primo caso potreste anche configurare mTLS mentre con il solo QNAP non penso sia fattibile.
Vi consiglio anche di abilitare l'autenticazione OAuth di goggle se decidete di esporre Immich all'esterno.