bbb3.0: graphql container, postgres with multiple db, repo updates

This commit is contained in:
chandi
2024-01-07 23:43:55 +01:00
parent 426349d0d7
commit 4b89a5b52f
22 changed files with 312 additions and 23 deletions

21
mod/postgres/initdb.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
set -e
set -u
function create_user_and_database() {
local database=$1
echo " Creating user and database '$database'"
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
CREATE DATABASE $database;
GRANT ALL PRIVILEGES ON DATABASE $database TO $POSTGRES_USER;
EOSQL
}
if [ -n "$POSTGRES_MULTIPLE_DATABASES" ]; then
echo "Multiple database creation requested: $POSTGRES_MULTIPLE_DATABASES"
for db in $(echo $POSTGRES_MULTIPLE_DATABASES | tr ',' ' '); do
create_user_and_database $db
done
echo "Multiple databases created"
fi