go-jwtserver/misc/containers/postgres/initdb.d/init-databases.sh

10 lines
315 B
Bash

#!/bin/bash
set -e
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER jwtserver WITH ENCRYPTED PASSWORD 'jwtserver';
CREATE DATABASE jwtserver;
GRANT ALL PRIVILEGES ON DATABASE jwtserver TO jwtserver;
ALTER DATABASE jwtserver OWNER TO jwtserver;
EOSQL