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

10 lines
315 B
Bash
Raw Permalink Normal View History

2020-07-16 10:51:50 +02:00
#!/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