Add immich

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-09-30 10:13:59 +01:00
parent 6ce084b652
commit 492b643d8b
18 changed files with 479 additions and 31 deletions

View File

@@ -0,0 +1,42 @@
{ pkgs, ... }:
let
entrypoint = pkgs.writeTextFile {
name = "entrypoint";
executable = true;
destination = "/bin/entrypoint";
text = builtins.readFile ./entrypoint.sh;
};
in
pkgs.dockerTools.buildImage {
name = "immich";
fromImage = pkgs.docker-image-base;
copyToRoot = pkgs.buildEnv {
name = "root";
paths = with pkgs; [
entrypoint
immich
curl
jq
];
pathsToLink = [
"/bin"
"/lib"
];
};
config = {
Entrypoint = [ "entrypoint" ];
Volumes = {
"/var/lib/immich" = { };
};
WorkingDir = "/var/lib/immich";
Env = [
"IMMICH_CONFIG_FILE=/etc/immich/config.json"
"IMMICH_MEDIA_LOCATION=/var/lib/immich"
];
ExposedPorts = {
"2283/tcp" = { };
};
};
}

View File

@@ -0,0 +1,16 @@
#!/usr/bin/env sh
set -o errexit
set -o nounset
server "$@" &
PID="$!"
if [ -f /etc/immich/post-start.sh ]; then
# shellcheck disable=SC1091
. /etc/immich/post-start.sh
fi
trap 'kill -KILL "$PID"' INT TERM
wait "$PID"
exit $?