Example hook for post user-add to auto-start mysql/mariadb for user:
mkdir /etc/openpanel/openpanel/hooks
nano /etc/openpanel/openpanel/hooks/prost_user-add.sh
and put:
#!/bin/bash
USER="$1"
DB_TYPE=$(grep '^MYSQL_TYPE=' /home/$USER/.env | cut -d'=' -f2 | tr -d '"')
if [[ "$DB_TYPE" == "mysql" || "$DB_TYPE" == "mariadb" ]]; then
cd "/home/$USER" && docker --context="$USER" compose up -d "$DB_TYPE"
fi