From 890dbc2a77372183fba6bde3cdfc2bfee3e6250a Mon Sep 17 00:00:00 2001 From: Livvy Mackintosh Date: Sun, 21 May 2017 01:52:58 +0200 Subject: [PATCH] Enable DB/user creation for weblate --- .../postgres/docker-entrypoint-initdb.d/init-user-db.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 support/postgres/docker-entrypoint-initdb.d/init-user-db.sh diff --git a/support/postgres/docker-entrypoint-initdb.d/init-user-db.sh b/support/postgres/docker-entrypoint-initdb.d/init-user-db.sh new file mode 100644 index 0000000..6a8aa81 --- /dev/null +++ b/support/postgres/docker-entrypoint-initdb.d/init-user-db.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL + CREATE USER weblate WITH PASSWORD '$POSTGRES_PASSWORD'; + CREATE DATABASE weblate; + GRANT ALL PRIVILEGES ON DATABASE weblate TO weblate; +EOSQL