Add an immich server
This commit is contained in:
106
2-nomad-config/immich.nomad.hcl
Normal file
106
2-nomad-config/immich.nomad.hcl
Normal file
@@ -0,0 +1,106 @@
|
||||
job "immich" {
|
||||
group "immich" {
|
||||
network {
|
||||
mode = "bridge"
|
||||
port "http" {
|
||||
to = 2283
|
||||
}
|
||||
}
|
||||
service {
|
||||
connect {
|
||||
sidecar_service {
|
||||
proxy {
|
||||
# TODO https://docs.immich.app/administration/postgres-standalone#prerequisites
|
||||
upstreams {
|
||||
destination_name = "postgres"
|
||||
local_bind_port = 5432
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task "immich-server" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "ghcr.io/immich-app/immich-server:release"
|
||||
ports = ["http"]
|
||||
}
|
||||
|
||||
service {
|
||||
name = "immich"
|
||||
port = "http"
|
||||
|
||||
tags = [
|
||||
"traefik.enable=true",
|
||||
"traefik.http.routers.immich.middlewares=auth@file",
|
||||
]
|
||||
|
||||
# Todo try GET /server/ping (https://api.immich.app/endpoints/server/pingServer)
|
||||
# https://github.com/immich-app/immich-charts/blob/main/charts/immich/templates/server.yaml#L57
|
||||
check {
|
||||
name = "alive"
|
||||
type = "tcp"
|
||||
port = "http"
|
||||
interval = "10s"
|
||||
timeout = "2s"
|
||||
}
|
||||
}
|
||||
|
||||
env {
|
||||
UPLOAD_LOCATION = "./library"
|
||||
TZ = "Australia/Melbourne"
|
||||
REDIS_HOSTNAME = "localhost"
|
||||
DB_HOSTNAME = "localhost"
|
||||
}
|
||||
|
||||
volume_mount {
|
||||
volume = "unraid_appdata_immich"
|
||||
destination = "/data"
|
||||
read_only = false
|
||||
}
|
||||
|
||||
resources {
|
||||
cpu = 200
|
||||
memory = 1024
|
||||
}
|
||||
|
||||
template {
|
||||
data = <<EOH
|
||||
DB_USERNAME="immich"
|
||||
DB_PASSWORD="{{ with nomadVar "nomad/jobs/immich" }}{{ .database_pw }}{{ end }}"
|
||||
EOH
|
||||
destination = "secrets/db.env"
|
||||
env = true # Load the file as environment variables
|
||||
}
|
||||
}
|
||||
|
||||
volume "unraid_appdata_immich" {
|
||||
type = "csi"
|
||||
read_only = false
|
||||
source = "unraid_appdata_immich"
|
||||
access_mode = "single-node-writer"
|
||||
attachment_mode = "file-system"
|
||||
|
||||
mount_options {
|
||||
mount_flags = ["uid=1000", "gid=1000"]
|
||||
}
|
||||
}
|
||||
|
||||
task "immich-machine-learning" {
|
||||
driver = "docker"
|
||||
config {
|
||||
image = "ghcr.io/immich-app/immich-machine-learning:release"
|
||||
}
|
||||
}
|
||||
|
||||
task "redis" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "docker.io/valkey/valkey:8-bookworm@sha256:fea8b3e67b15729d4bb70589eb03367bab9ad1ee89c876f54327fc7c6e618571"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user