all-in-one/Containers/postgresql/init-user-db.sh
szaimen e7dfb2514b fix the database connection
Signed-off-by: szaimen <szaimen@e.mail.de>
2022-02-13 11:44:59 +01:00

9 lines
263 B
Bash

#!/bin/bash
set -ex
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER "oc_$POSTGRES_USER" WITH PASSWORD "$POSTGRES_PASSWORD";
GRANT ALL PRIVILEGES ON DATABASE "$POSTGRES_DB" TO "oc_$POSTGRES_USER";
EOSQL
set +ex