initial commit

This commit is contained in:
2025-11-25 12:27:53 +03:30
commit f9d16ab078
102 changed files with 11156 additions and 0 deletions

21
config/postgres/init-db/init.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
set -e
set -u
function create_database_grant_privilege() {
local database=$1
echo " Creating database '$database' and granting privileges to '$POSTGRES_USER'"
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_database_grant_privilege $db
done
echo "Multiple databases created"
fi