feat(arion): add immich compose file
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-02-19 12:42:02 -05:00
parent 6f4765c7ea
commit b0313ac3d2
9 changed files with 125 additions and 5 deletions

View file

@ -86,7 +86,7 @@ in {
immich = { immich = {
subDomainName = "photos"; subDomainName = "photos";
reverseProxy = "${dockerIP}:2283"; reverseProxy = "${servivi}:2283";
}; };
# FreshRSS & Co # FreshRSS & Co

View file

@ -6,6 +6,7 @@ in {
./forgejo/compose.nix ./forgejo/compose.nix
./homepage/compose.nix ./homepage/compose.nix
./immich/compose.nix
./music/jbots/compose.nix ./music/jbots/compose.nix
]; ];

View file

@ -0,0 +1,12 @@
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich
REDIS_HOSTNAME=immich_redis
PUBLIC_LOGIN_PAGE_MESSAGE=
IMMICH_WEB_URL=http://immich-web:3000
IMMICH_SERVER_URL=http://immich-server:3001
IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003

View file

@ -0,0 +1,73 @@
{config, ...}: let
inherit (config.arion) rwDataDir;
rwPath = rwDataDir + "/immich";
UPLOAD_LOCATION = "${rwPath}/data";
in {
arion.projects."immich" = {
"immich_server" = {
image = ./images/server.nix;
command = ["start.sh" "immich"];
env_file = ["${./.env}"];
volumes = [
"${UPLOAD_LOCATION}:/usr/src/app/upload:rw"
];
ports = [
"2283:3001"
];
depends_on = ["immich_redis" "immich_postgres"];
restart = "always";
environment.NODE_ENV = "production";
};
"immich_microservices" = {
image = ./images/server.nix;
command = ["start.sh" "microservices"];
env_file = ["${./.env}"];
volumes = [
"${UPLOAD_LOCATION}:/usr/src/app/upload:rw"
];
depends_on = ["immich_redis" "immich_postgres"];
restart = "always";
};
"immich_machine_learning" = {
image = ./images/machine-learning.nix;
restart = "always";
env_file = ["${./.env}"];
volumes = [
"${rwPath}/cache:/cache"
];
};
"immich_redis" = {
image = ./images/redis.nix;
restart = "always";
tmpfs = ["/data"];
env_file = ["${./.env}"];
};
"immich_postgres" = {
image = ./images/postgres.nix;
restart = "always";
env_file = ["${./.env}"];
volumes = [
"${rwPath}/db:/var/lib/postgresql/data"
];
environment = {
POSTGRES_PASSWORD = "\${DB_PASSWORD}";
POSTGRES_USER = "\${DB_USERNAME}";
POSTGRES_DB = "\${DB_DATABASE_NAME}";
};
};
};
}

View file

@ -0,0 +1,8 @@
pkgs:
pkgs.dockerTools.pullImage {
imageName = "ghcr.io/immich-app/immich-machine-learning";
imageDigest = "sha256:a3c612c548d5f547a31d001d97f661d7acd4a0ae354de76a70e45162d2b81014";
sha256 = "1ij5x6lw80qwsjv8vb0nlc86kj0blss3gn34md8fgrz2rqjxr5nz";
finalImageName = "ghcr.io/immich-app/immich-machine-learning";
finalImageTag = "release";
}

View file

@ -0,0 +1,8 @@
pkgs:
pkgs.dockerTools.pullImage {
imageName = "tensorchord/pgvecto-rs";
imageDigest = "sha256:0335a1a22f8c5dd1b697f14f079934f5152eaaa216c09b61e293be285491f8ee";
sha256 = "1930m92kd3jxn1d6fj5py6b6rldvswhc4vyn9qkx98cc9v81yamc";
finalImageName = "tensorchord/pgvecto-rs";
finalImageTag = "pg14-v0.1.11";
}

View file

@ -0,0 +1,9 @@
# Locked
pkgs:
pkgs.dockerTools.pullImage {
imageName = "redis";
imageDigest = "sha256:70a7a5b641117670beae0d80658430853896b5ef269ccf00d1827427e3263fa3";
sha256 = "1d14llwfzjfpzyz7x1a46fzrrg3i6k7z89jqql3sfisb7i4kgp2j";
finalImageName = "redis";
finalImageTag = "6.2-alpine";
}

View file

@ -0,0 +1,8 @@
pkgs:
pkgs.dockerTools.pullImage {
imageName = "ghcr.io/immich-app/immich-server";
imageDigest = "sha256:c7b80752d48464dea1c4495ff810365a0809d89c2ac219547d3c1aed81c6411f";
sha256 = "108ipvbs8fns3dq65m754q7f82d3pgk6zig1ajixbvj9p0xqwh9a";
finalImageName = "ghcr.io/immich-app/immich-server";
finalImageTag = "release";
}

View file

@ -112,14 +112,15 @@ in {
runtimeInputs = [nix-prefetch-docker]; runtimeInputs = [nix-prefetch-docker];
text = '' text = ''
FILE="$1" FILE="$1"
IMAGE=$(sed -n 's/.*imageName = "\([^"]*\).*/\1/p' "$FILE") IMAGE=$(sed -n 's/.*imageName = "\([^"]*\).*/\1/p' "$FILE")
TAG=$(sed -n 's/.*finalImageTag = "\([^"]*\).*/\1/p' "$FILE") TAG=$(sed -n 's/.*finalImageTag = "\([^"]*\).*/\1/p' "$FILE")
echo "$IMAGE $TAG" echo "$IMAGE $TAG"
if ! grep "Locked" "$FILE"; then
PREFETCH=$(nix-prefetch-docker "$IMAGE" "$TAG") PREFETCH=$(nix-prefetch-docker "$IMAGE" "$TAG")
echo -e "pkgs:\npkgs.dockerTools.pullImage $PREFETCH" > "$FILE" echo -e "pkgs:\npkgs.dockerTools.pullImage $PREFETCH" > "$FILE"
fi
''; '';
}) })
]; ];