I do exactly that.
So, step1 is to get mariadb running. Use the big blue button to launch docker image. You can use image repo of bitnami/mariadb and tag whatever tag you want, maybe latest, maybe a specific version, etc. Environment variables you'll probably want to define are:
TZ
MARIADB_SKIP_TEST_DB set to yes to not create a test database and users
MARIADB_DATABASE initial database you want to create, maybe photoprism
MARIADB_USER initial database user you want to use, again maybe photoprism
MARIADB_PASSWORD initial database password you want
MARIADB_ROOT_PASSWORD admin password
Generally, you can find details for docker apps on the docker hub website.
Assuming you are not using a bridge to assign it's own IP, you'll need to define the "port forward" in the app config also. So, 3306 maybe use for Scale 33306.
Hostpaths you will potentially want:
/bitnami/mariadb/data which is your actual database files
/opt/bitnami/mariadb/conf which is the mysql config files
The docker hub site documents how to override the config file. You'll want to change the port
I also define a /Backup hostpath as I have an in container backup script so I can do a consistant backup as opposed to just snapshots which may or may not be consistent.
So, pretty much like running docker anywhere else.
To point at mariadb from your photoprism container (it may or may not work via truecharts, I don't and never will use them), I generally use heavy script utility to find internal DNS names.
Run heavyscript and use option 1, then 1 again and look for your internal DNS name. For me, it is mariadb-ix-chart.ix-mariadb.svc.cluster.local
Now that I have the heavyscript DNS name, you can install the photoprism app, you'll need at least the following environment variables:
PHOTOPRISM_DATABASE_DRIVER set to mysql
PHOTOPRISM_DATABASE_SERVER set to internal dns name and port, for me mariadb-ix-chart.ix-mariadb.svc.cluster.local:3306
PHOTOPRISM_DATABASE_NAME would be your MySQL database name
PHOTOPRISM_DATABASE_USER would be your database user
PHOTOPRISM_DATABASE_PASSWORD would be your database password
And continue on installing photoprism, not going to go into that as there are many posts I've seen about that.
HeavyScript is used by quite a few here to backup application pool and other things like this.
That should do it. I actually did not do it this way for mariadb as I wanted to the the standard port for all sorts of other apps I have that use mariadb and are not on the truenas server. So, I created a bridge interface and gave mariadb it's own IP which then allowed me to use the standard port. This is not necessary for you though. My point in mentioning is it is quite possible I neglected something but get mariadb working first and if you use a tool such as dbeaver or mysql workbench, etc., then see if you can connect to mariadb from another machine to test the install.
It seems like a lot of steps, but it's not much different than using docker to me at least. You still need to assign hostpaths with docker, set environment variables, etc. so if you are familiar with docker, then, this shouldn't take but a few minutes to get mariadb running. I will say I created a specific dataset for mariadb as I wanted to use a recordsize of 16k for the mariadb database hostpath.