{ pkgs, ... }: let entrypoint = pkgs.writeTextFile { name = "entrypoint"; executable = true; destination = "/bin/entrypoint"; text = builtins.readFile ./entrypoint.sh; }; in pkgs.dockerTools.buildImage { name = "immich-machine-learning"; fromImage = pkgs.docker-image-base; copyToRoot = pkgs.buildEnv { name = "root"; paths = with pkgs; [ entrypoint immich-machine-learning ]; pathsToLink = [ "/bin" "/lib" "/share" "/nix-support" ]; }; config = { Entrypoint = [ "entrypoint" ]; Volumes = { "/tmp/immich-machine-learning" = { }; }; Env = [ "IMMICH_LOG_LEVEL=warn" "MACHINE_LEARNING_CACHE_FOLDER=/tmp/immich-machine-learning" ]; ExposedPorts = { "3003/tcp" = { }; }; }; }