Photoprismβ’ "is a server-based application for browsing, organizing and sharing your personal photo collection. It makes use of the latest technologies to automatically tag and find pictures without getting in your way. Say goodbye to solutions that force you to upload your visual memories to the cloud."
DNS entry for the hostname you intend to use (or a wildcard), pointed to your keepalived IP
Related:
Traefik Forward Auth or Authelia to secure your Traefik-exposed services with an additional layer of authentication
Preparation
Setup data locations
First we need a folder to map the photoprism config file:
mkdir/var/data/photoprism/config
We will need a location to store photoprism thumbnails, as they can be recreated anytime (althought depending on your collection size it could take a while), we store them on a "non-backed-up" folder
mkdir/var/data/runtime/photoprism/cache
We will need to map three folders on our system / data:
originals - the folder where our original photo collection is stored (photoprism doesn't modify any original file, it only adds sidecars files).
import - the folder where photoprism will pick new photos to be added to the collection
export - the folder where photoprism will export photos.
In order to be able to import/export files from / to the originals folder make sure that the running user of the photoprims instance has write / read access to those folders.
Photoprism has with its own running db, but if your collection is big (10K photos or more), the perfomance is best using an external db instance. We will use MariaDb, so we need the folders for running and backing the db:
Now create a separate photoprism-db-backup.env file, to capture the environment variables necessary to perform the backup. (If the same variables are shared with the mariadb container, they cause issues with database access)
# For database backup (keep 7 days daily backups)MYSQL_PWD=<settosomethingsecure,sameasMYSQL_ROOT_PASSWORDabove>
MYSQL_USER=root
BACKUP_NUM_KEEP=7BACKUP_FREQUENCY=1d
Photoprism Docker Swarm config
Create a docker swarm config file in docker-compose syntax (v3), something like the example below:
Fast-track with premix! π
"Premix" is a git repository which includes necessary docker-compose and env files for all published recipes. This means that you can launch any recipe with just a git pull and a docker stack deploy π.
π Update: Premix now includes an ansible playbook, enabling you to deploy an entire stack + recipes, with a single ansible command! (more here)
Setup unique static subnets for every stack you deploy. This avoids IP/gateway conflicts which can otherwise occur when you're creating/removing stacks a lot. See my list here.
Serving
Launch Photoprism stack
Launch the Photoprism stack by running docker stack deploy photoprism -c <path -to-docker-compose.yml>
Browse to your new browser-cli-terminal at https://YOUR-FQDN, with user "admin" and the password you specified in photoprism.env
Did you receive excellent service? Want to compliment the chef? (..and support development of current and future recipes!) Sponsor me on Github / Ko-Fi / Patreon, or see the contribute page for more (free or paid) ways to say thank you! π
Employ your chef (engage) π€
Is this too much of a geeky PITA? Do you just want results, stat? I do this for a living - I'm a full-time Kubernetes contractor, providing consulting and engineering expertise to businesses needing short-term, short-notice support in the cloud-native space, including AWS/Azure/GKE, Kubernetes, CI/CD and automation.
Want to know now when this recipe gets updated, or when future recipes are added? Subscribe to the RSS feed, or leave your email address below, and we'll keep you updated.