2024-02-19 12:42:02 -05:00
|
|
|
{config, ...}: let
|
2024-02-23 00:43:16 -05:00
|
|
|
inherit (config.sops) secrets;
|
2024-02-19 12:42:02 -05:00
|
|
|
inherit (config.arion) rwDataDir;
|
|
|
|
|
|
|
|
rwPath = rwDataDir + "/immich";
|
|
|
|
|
|
|
|
UPLOAD_LOCATION = "${rwPath}/data";
|
|
|
|
in {
|
|
|
|
arion.projects."immich" = {
|
|
|
|
"immich_server" = {
|
|
|
|
image = ./images/server.nix;
|
2024-02-23 00:43:16 -05:00
|
|
|
env_file = [
|
2024-03-17 13:17:43 -04:00
|
|
|
"${./env}"
|
2024-02-23 00:43:16 -05:00
|
|
|
secrets.immich.path
|
|
|
|
];
|
2024-02-19 12:42:02 -05:00
|
|
|
|
|
|
|
volumes = [
|
|
|
|
"${UPLOAD_LOCATION}:/usr/src/app/upload:rw"
|
|
|
|
];
|
|
|
|
ports = [
|
|
|
|
"2283:3001"
|
|
|
|
];
|
|
|
|
|
|
|
|
depends_on = ["immich_redis" "immich_postgres"];
|
|
|
|
restart = "always";
|
|
|
|
|
|
|
|
environment.NODE_ENV = "production";
|
|
|
|
};
|
|
|
|
|
|
|
|
"immich_machine_learning" = {
|
|
|
|
image = ./images/machine-learning.nix;
|
|
|
|
restart = "always";
|
2024-02-23 00:43:16 -05:00
|
|
|
env_file = [
|
2024-03-17 13:17:43 -04:00
|
|
|
"${./env}"
|
2024-02-23 00:43:16 -05:00
|
|
|
secrets.immich.path
|
|
|
|
];
|
2024-02-19 12:42:02 -05:00
|
|
|
|
|
|
|
volumes = [
|
|
|
|
"${rwPath}/cache:/cache"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
"immich_redis" = {
|
|
|
|
image = ./images/redis.nix;
|
|
|
|
restart = "always";
|
|
|
|
tmpfs = ["/data"];
|
2024-02-23 00:43:16 -05:00
|
|
|
env_file = [
|
2024-03-17 13:17:43 -04:00
|
|
|
"${./env}"
|
2024-02-23 00:43:16 -05:00
|
|
|
secrets.immich.path
|
|
|
|
];
|
2024-02-19 12:42:02 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
"immich_postgres" = {
|
|
|
|
image = ./images/postgres.nix;
|
|
|
|
restart = "always";
|
2024-02-23 00:43:16 -05:00
|
|
|
env_file = [
|
2024-03-17 13:17:43 -04:00
|
|
|
"${./env}"
|
2024-02-23 00:43:16 -05:00
|
|
|
secrets.immich.path
|
|
|
|
];
|
2024-02-19 12:42:02 -05:00
|
|
|
|
|
|
|
volumes = [
|
|
|
|
"${rwPath}/db:/var/lib/postgresql/data"
|
|
|
|
];
|
|
|
|
|
|
|
|
environment = {
|
|
|
|
POSTGRES_PASSWORD = "\${DB_PASSWORD}";
|
|
|
|
POSTGRES_USER = "\${DB_USERNAME}";
|
|
|
|
POSTGRES_DB = "\${DB_DATABASE_NAME}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|