summaryrefslogtreecommitdiff
path: root/examples/docker/postgres-init.sh
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-05-05 11:22:38 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-05-05 11:22:38 +0200
commit8c23c960426bad133484bf127f5fc5b56af8e8c7 (patch)
treed96d4ef00707088913fed0b97fb03eb56a2064c0 /examples/docker/postgres-init.sh
parent4696f8d68e130632cbcdb14c2bb1dfe71355e9f6 (diff)
parenta1a0f33cab731eb60051af6bd5ae78cd6660b76f (diff)
Merge branch 'feuerrot-dockerize'
Addresses #4
Diffstat (limited to 'examples/docker/postgres-init.sh')
-rw-r--r--examples/docker/postgres-init.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/docker/postgres-init.sh b/examples/docker/postgres-init.sh
new file mode 100644
index 0000000..a8c59d1
--- /dev/null
+++ b/examples/docker/postgres-init.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+set -e
+
+psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
+ CREATE USER ${TRAVELYNX_DB_USERNAME} PASSWORD '${TRAVELYNX_DB_PASSWORD}';
+ CREATE DATABASE ${TRAVELYNX_DB_NAME};
+ GRANT ALL PRIVILEGES ON DATABASE ${TRAVELYNX_DB_NAME} TO ${TRAVELYNX_DB_USERNAME};
+EOSQL \ No newline at end of file