server-origin/init-db/init-database.sh
2024-06-23 10:22:15 +05:00

15 lines
501 B
Bash

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