From 668c570b2e0aae2c73e5bb919262cbcd0d52e14d Mon Sep 17 00:00:00 2001 From: Sergio <77530549+sergi0g@users.noreply.github.com> Date: Sat, 21 Sep 2024 20:07:35 +0300 Subject: [PATCH 1/5] chore: migrate immich to dynamic compose --- apps/immich/config.json | 1 + apps/immich/docker-compose.json | 88 +++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 apps/immich/docker-compose.json diff --git a/apps/immich/config.json b/apps/immich/config.json index 3551ce113f..857ef87849 100644 --- a/apps/immich/config.json +++ b/apps/immich/config.json @@ -34,6 +34,7 @@ } ], "supported_architectures": ["arm64", "amd64"], + "dynamic_config": true, "created_at": 1691943801422, "updated_at": 1726211612000 } diff --git a/apps/immich/docker-compose.json b/apps/immich/docker-compose.json new file mode 100644 index 0000000000..77fda52484 --- /dev/null +++ b/apps/immich/docker-compose.json @@ -0,0 +1,88 @@ +{ + "$schema": "../compose-schema.json", + "services": [ + { + "name": "immich", + "image": "ghcr.io/immich-app/immich-server:v1.115.0", + "volumes": [ + { + "hostPath": "${ROOT_FOLDER_HOST}/media/data/images/immich", + "containerPath": "/usr/src/app/upload" + } + ], + "environment": { + "NODE_ENV": "production", + "DB_HOSTNAME": "immich-db", + "DB_USERNAME": "tipi", + "DB_PASSWORD": "${DB_PASSWORD}", + "ENABLE_MAPBOX": "false", + "DB_DATABASE_NAME": "immich", + "REDIS_HOSTNAME": "immich-redis", + "JWT_SECRET": "${JWT_SECRET}" + }, + "dependsOn": [ + "immich-redis", + "immich-db" + ], + "internalPort": 3001 + }, + { + "name": "immich-machine-learning", + "image": "ghcr.io/immich-app/immich-machine-learning:v1.115.0", + "volumes": [ + { + "hostPath": "${ROOT_FOLDER_HOST}/media/data/images/immich", + "containerPath": "/usr/src/app/upload" + }, + { + "hostPath": "${APP_DATA_DIR}/data/immich-ml-cache", + "containerPath": "/cache" + } + ], + "environment": { + "NODE_ENV": "production", + "DB_HOSTNAME": "immich-db", + "DB_USERNAME": "tipi", + "DB_PASSWORD": "${DB_PASSWORD}", + "DB_NAME": "immich", + "DB_DATABASE_NAME": "immich" + }, + "dependsOn": [ + "immich-db" + ] + }, + { + "name": "immich-redis", + "image": "redis:6.2", + "healthCheck": { + "test": "redis-cli ping || exit 1", + "interval": "30s", + "timeout": "1m", + "retries": 5 + } + }, + { + "name": "immich-db", + "image": "tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0", + "environment": { + "POSTGRES_PASSWORD": "${DB_PASSWORD}", + "POSTGRES_USER": "tipi", + "POSTGRES_DB": "immich", + "PG_DATA": "/var/lib/postgresql/data" + }, + "volumes": [ + { + "hostPath": "${APP_DATA_DIR}/data/db", + "containerPath": "/var/lib/postgresql/data" + } + ], + "healthCheck": { + "test": "pg_isready --dbname='${DB_DATABASE_NAME}' || exit 1; Chksum=\"$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database')\"; echo \"checksum failure count is $$Chksum\"; [ \"$$Chksum\" = '0' ] || exit 1", + "interval": "5m", + "startInterval": "30s", + "startPeriod": "5m" + }, + "command": "postgres -c shared_preload_libraries=vectors.so -c search_path=\"$$user\", public, vectors -c logging_collector=on -c max_wal_size=2GB -c shared_buffers=512MB -c wal_compression=on" + } + ] +} \ No newline at end of file From 34af10703b2e0080043feea59b1f13ed8b340241 Mon Sep 17 00:00:00 2001 From: Sergio <77530549+sergi0g@users.noreply.github.com> Date: Sat, 21 Sep 2024 20:26:22 +0300 Subject: [PATCH 2/5] Change command to array syntax --- apps/immich/docker-compose.json | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/immich/docker-compose.json b/apps/immich/docker-compose.json index 77fda52484..27e7de1b0c 100644 --- a/apps/immich/docker-compose.json +++ b/apps/immich/docker-compose.json @@ -82,7 +82,21 @@ "startInterval": "30s", "startPeriod": "5m" }, - "command": "postgres -c shared_preload_libraries=vectors.so -c search_path=\"$$user\", public, vectors -c logging_collector=on -c max_wal_size=2GB -c shared_buffers=512MB -c wal_compression=on" + "command": [ + "postgres", + "-c", + "shared_preload_libraries=vectors.so", + "-c", + "'search_path=\"$$user\", public, vectors'", + "-c", + "logging_collector=on", + "-c", + "max_wal_size=2GB", + "-c", + "shared_buffers=512MB", + "-c", + "wal_compression=on" + ] } ] } \ No newline at end of file From 4edd4a9eea6aaa4748b32492c7c7b09d83816048 Mon Sep 17 00:00:00 2001 From: Sergio <77530549+sergi0g@users.noreply.github.com> Date: Sat, 21 Sep 2024 20:37:09 +0300 Subject: [PATCH 3/5] Fix command --- apps/immich/docker-compose.json | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/apps/immich/docker-compose.json b/apps/immich/docker-compose.json index 27e7de1b0c..5c5140ab45 100644 --- a/apps/immich/docker-compose.json +++ b/apps/immich/docker-compose.json @@ -82,21 +82,7 @@ "startInterval": "30s", "startPeriod": "5m" }, - "command": [ - "postgres", - "-c", - "shared_preload_libraries=vectors.so", - "-c", - "'search_path=\"$$user\", public, vectors'", - "-c", - "logging_collector=on", - "-c", - "max_wal_size=2GB", - "-c", - "shared_buffers=512MB", - "-c", - "wal_compression=on" - ] + "command": ["postgres", "-c" ,"shared_preload_libraries=vectors.so", "-c", "search_path=\"$$user\", public, vectors", "-c", "logging_collector=on", "-c", "max_wal_size=2GB", "-c", "shared_buffers=512MB", "-c", "wal_compression=on"] } ] } \ No newline at end of file From 350b588e5b1147740405050ebd7eb79c830ee988 Mon Sep 17 00:00:00 2001 From: Sergio <77530549+sergi0g@users.noreply.github.com> Date: Sun, 22 Sep 2024 14:49:55 +0300 Subject: [PATCH 4/5] Update config.json and compose --- apps/immich/config.json | 4 ++-- apps/immich/docker-compose.json | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/immich/config.json b/apps/immich/config.json index 857ef87849..4ca7ff136d 100644 --- a/apps/immich/config.json +++ b/apps/immich/config.json @@ -5,7 +5,7 @@ "exposable": true, "port": 8128, "id": "immich", - "tipi_version": 104, + "tipi_version": 105, "version": "1.115.0", "categories": ["data", "photography"], "description": "Photo and video backup solution directly from your mobile phone.", @@ -36,5 +36,5 @@ "supported_architectures": ["arm64", "amd64"], "dynamic_config": true, "created_at": 1691943801422, - "updated_at": 1726211612000 + "updated_at": 1727005741000 } diff --git a/apps/immich/docker-compose.json b/apps/immich/docker-compose.json index 5c5140ab45..39b434136f 100644 --- a/apps/immich/docker-compose.json +++ b/apps/immich/docker-compose.json @@ -24,7 +24,8 @@ "immich-redis", "immich-db" ], - "internalPort": 3001 + "internalPort": 3001, + "isMain": true }, { "name": "immich-machine-learning", From 06dd4d29b08f3a9c69198ac260933df7995ce8f8 Mon Sep 17 00:00:00 2001 From: Sergio <77530549+sergi0g@users.noreply.github.com> Date: Sun, 22 Sep 2024 14:57:48 +0300 Subject: [PATCH 5/5] Add `min_tipi_version` --- apps/immich/config.json | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/immich/config.json b/apps/immich/config.json index 4ca7ff136d..d85712a7cd 100644 --- a/apps/immich/config.json +++ b/apps/immich/config.json @@ -7,6 +7,7 @@ "id": "immich", "tipi_version": 105, "version": "1.115.0", + "min_tipi_version": "3.6.2", "categories": ["data", "photography"], "description": "Photo and video backup solution directly from your mobile phone.", "short_desc": "Photo and video backup solution directly from your mobile phone.",