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

View File

@ -12,8 +12,8 @@ job "photoprism" {
}
}
task "Backup database" {
mysql "Backup database" {
task "Dump database" {
mysql "Dump database" {
hostname = env("MYSQL_HOST")
port = env("MYSQL_PORT")
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 {
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
restore_opts {
Target = "/"

View File

@ -102,13 +102,15 @@ module "minitor" {
module "photoprism_module" {
source = "./service"
name = "photoprism"
image = "photoprism/photoprism:221105-jammy"
ingress = true
service_port = 2342
sticky_disk = true
healthcheck_path = "/library/login"
name = "photoprism"
image = "photoprism/photoprism:221118-jammy"
image_pull_timeout = "10m"
ingress = true
service_port = 2342
sticky_disk = true
healthcheck_path = "/library/login"
env = {
PHOTOPRISM_DEBUG = true
# UI
PHOTOPRISM_SITE_CAPTION = "AI-Powered Photos App"
PHOTOPRISM_SITE_DESCRIPTION = "Fijolek home photos"
@ -120,7 +122,7 @@ module "photoprism_module" {
# Paths
PHOTOPRISM_ORIGINALS_PATH = "/photoprism-media/Library"
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
PHOTOPRISM_UID = 500
PHOTOPRISM_GID = 100
@ -134,6 +136,11 @@ module "photoprism_module" {
use_mysql = true
use_vault = true
host_volumes = [
{
name = "photoprism-storage"
dest = "/photoprism-storage"
read_only = false
},
{
name = "photoprism-media"
dest = "/photoprism-media"