diff --git a/services/main.tf b/services/main.tf index 09b6fb3..bf38f2c 100644 --- a/services/main.tf +++ b/services/main.tf @@ -73,6 +73,15 @@ module "photoprism_module" { ingress = true service_port = 2342 sticky_disk = true + constraints = [{ + attribute = "$${meta.hw_transcode.type}" + # operator = "is_set" + value = "raspberry" + }] + docker_devices = [{ + host_path = "$${meta.hw_transcode.device}" + container_path = "$${meta.hw_transcode.device}" + }] env = { PHOTOPRISM_DEBUG = true # UI @@ -126,6 +135,13 @@ module "photoprism_module" { PHOTOPRISM_DATABASE_SERVER="{{ .Address }}:{{ .Port }}" {{- end }} {{- end }} + {{ if eq (env "meta.hw_transcode.type") "raspberry" -}} + PHOTOPRISM_FFMPEG_ENCODER=raspberry + PHOTOPRISM_FFMPEG_BUFFERS=64 + {{ else if eq (env "meta.hw_transcode.type") "intel" -}} + PHOTOPRISM_FFMPEG_ENCODER=intel + PHOTOPRISM_INIT="intel tensorflow" + {{- end }} EOF dest_prefix = "$${NOMAD_SECRETS_DIR}/" dest = "env"