From e721cdf6d79d6070beb6a09d3b526b8d219fdbc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= Date: Sun, 7 Aug 2022 12:17:29 +0200 Subject: [PATCH] feat: update immich --- services/immich.nix | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/services/immich.nix b/services/immich.nix index 0158b61..0514ed6 100644 --- a/services/immich.nix +++ b/services/immich.nix @@ -12,7 +12,7 @@ let pgSuperUser = config.services.postgresql.superUser; - immichEnv = { + immichBase = { environment = { NODE_ENV = "production"; DB_HOSTNAME = containersHost; @@ -21,10 +21,16 @@ let DB_DATABASE_NAME = dbname; REDIS_HOSTNAME = containersHost; REDIS_PORT = toString config.services.redis.servers.immich.port; - VITE_SERVER_ENDPOINT = "https://${domain}/api"; }; # only secrets need to be included, e.g. DB_PASSWORD, JWT_SECRET, MAPBOX_KEY environmentFiles = [ config.age.secrets.immich-env.path ]; + extraOptions = [ + "--network=host" + "--add-host=immich-server:127.0.0.1" + "--add-host=immich-microservices:127.0.0.1" + "--add-host=immich-machine-learning:127.0.0.1" + "--add-host=immich-web:127.0.0.1" + ]; }; in { age.secrets.immich-env.file = ../secrets/immich/.env.age; @@ -72,37 +78,33 @@ in { }; virtualisation.oci-containers.containers = { - immich-server = immichEnv // { + immich-server = immichBase // { image = "altran1502/immich-server:release"; ports = [ "3001:3001" ]; entrypoint = "/bin/sh"; cmd = [ "./start-server.sh" ]; volumes = [ "${uploadDir}:/usr/src/app/upload" ]; - extraOptions = [ "--network=host" ]; }; - immich-microservices = immichEnv // { + immich-microservices = immichBase // { image = "altran1502/immich-server:release"; entrypoint = "/bin/sh"; cmd = [ "./start-microservices.sh" ]; volumes = [ "${uploadDir}:/usr/src/app/upload" ]; - extraOptions = [ "--network=host" ]; }; - immich-machine-learning = immichEnv // { + immich-machine-learning = immichBase // { image = "altran1502/immich-machine-learning:release"; entrypoint = "/bin/sh"; cmd = [ "./entrypoint.sh" ]; volumes = [ "${uploadDir}:/usr/src/app/upload" ]; - extraOptions = [ "--network=host" ]; }; - immich-web = immichEnv // { + immich-web = immichBase // { image = "altran1502/immich-web:release"; ports = [ "3000:3000" ]; entrypoint = "/bin/sh"; cmd = [ "./entrypoint.sh" ]; - extraOptions = [ "--network=host" ]; }; };