Update photoprism and use new storage path

This commit is contained in:
IamTheFij 2023-02-27 11:51:28 -08:00
parent 9fe63d03d9
commit 3a8cca53f3
3 changed files with 38 additions and 18 deletions

View File

@ -28,6 +28,11 @@ all:
owner: "nobody" owner: "nobody"
group: "bin" group: "bin"
read_only: false read_only: false
- name: photoprism-storage
path: /srv/volumes/moxy/photoprism-storage
owner: "nobody"
group: "bin"
read_only: false
n2.thefij: n2.thefij:
nfs_mounts: nfs_mounts:
- src: 10.50.250.2:/srv/volumes - src: 10.50.250.2:/srv/volumes
@ -61,6 +66,12 @@ all:
group: "bin" group: "bin"
mode: "0755" mode: "0755"
read_only: false read_only: false
- name: photoprism-storage
path: /srv/volumes/moxy/photoprism-storage
owner: "nobody"
group: "bin"
mode: "0755"
read_only: false
# n3.thefij: # n3.thefij:
# nomad_node_class: ingress # nomad_node_class: ingress
# nomad_node_role: both # nomad_node_role: both

View File

@ -12,8 +12,8 @@ job "photoprism" {
} }
} }
task "Backup database" { task "Dump database" {
mysql "Backup database" { mysql "Dump database" {
hostname = env("MYSQL_HOST") hostname = env("MYSQL_HOST")
port = env("MYSQL_PORT") port = env("MYSQL_PORT")
database = "photoprism" database = "photoprism"
@ -24,16 +24,18 @@ job "photoprism" {
} }
} }
# NOTE: Right now the cache and sidecar files are stored in the task local
# storage and not in a volume that can be backed up. This was done to allow
# Photoprism to be moved between hosts. If this directory becomes large and
# costly to move between hosts or regenerate, then it may be worth putting it
# on a host volume so it can be backed up as well. Possibly once I get NFS
# shares running from the Proxmox host available to the VMs for faster shared
# storage.
backup { backup {
paths = ["/local/photoprism"] paths = [
"/local/photoprism",
# NOTE: Right now the cache and sidecar files are stored in the task local
# storage and not in a volume that can be backed up. This was done to allow
# Photoprism to be moved between hosts. If this directory becomes large and
# costly to move between hosts or regenerate, then it may be worth putting it
# on a host volume so it can be backed up as well. Possibly once I get NFS
# shares running from the Proxmox host available to the VMs for faster shared
# storage.
"/data/moxy/photoprism-storage",
]
# Because path is absolute # Because path is absolute
restore_opts { restore_opts {
Target = "/" Target = "/"

View File

@ -102,13 +102,15 @@ module "minitor" {
module "photoprism_module" { module "photoprism_module" {
source = "./service" source = "./service"
name = "photoprism" name = "photoprism"
image = "photoprism/photoprism:221105-jammy" image = "photoprism/photoprism:221118-jammy"
ingress = true image_pull_timeout = "10m"
service_port = 2342 ingress = true
sticky_disk = true service_port = 2342
healthcheck_path = "/library/login" sticky_disk = true
healthcheck_path = "/library/login"
env = { env = {
PHOTOPRISM_DEBUG = true
# UI # UI
PHOTOPRISM_SITE_CAPTION = "AI-Powered Photos App" PHOTOPRISM_SITE_CAPTION = "AI-Powered Photos App"
PHOTOPRISM_SITE_DESCRIPTION = "Fijolek home photos" PHOTOPRISM_SITE_DESCRIPTION = "Fijolek home photos"
@ -120,7 +122,7 @@ module "photoprism_module" {
# Paths # Paths
PHOTOPRISM_ORIGINALS_PATH = "/photoprism-media/Library" PHOTOPRISM_ORIGINALS_PATH = "/photoprism-media/Library"
PHOTOPRISM_IMPORT_PATH = "/photoprism-media/Import" PHOTOPRISM_IMPORT_PATH = "/photoprism-media/Import"
PHOTOPRISM_STORAGE_PATH = "$${NOMAD_TASK_DIR}/storage" # Storage PATH for generated files like cache and index PHOTOPRISM_STORAGE_PATH = "/photoprism-storage" # Storage PATH for generated files like cache and thumbnails
# Unix permissions # Unix permissions
PHOTOPRISM_UID = 500 PHOTOPRISM_UID = 500
PHOTOPRISM_GID = 100 PHOTOPRISM_GID = 100
@ -134,6 +136,11 @@ module "photoprism_module" {
use_mysql = true use_mysql = true
use_vault = true use_vault = true
host_volumes = [ host_volumes = [
{
name = "photoprism-storage"
dest = "/photoprism-storage"
read_only = false
},
{ {
name = "photoprism-media" name = "photoprism-media"
dest = "/photoprism-media" dest = "/photoprism-media"