aboutsummaryrefslogtreecommitdiffstats
path: root/ransim/docker/config/db
diff options
context:
space:
mode:
Diffstat (limited to 'ransim/docker/config/db')
-rw-r--r--ransim/docker/config/db/db.conf1
-rw-r--r--ransim/docker/config/db/db.sh9
2 files changed, 10 insertions, 0 deletions
diff --git a/ransim/docker/config/db/db.conf b/ransim/docker/config/db/db.conf
new file mode 100644
index 0000000..ec5ebd2
--- /dev/null
+++ b/ransim/docker/config/db/db.conf
@@ -0,0 +1 @@
+MYSQL_ROOT_PASSWORD=secret
diff --git a/ransim/docker/config/db/db.sh b/ransim/docker/config/db/db.sh
new file mode 100644
index 0000000..4f988be
--- /dev/null
+++ b/ransim/docker/config/db/db.sh
@@ -0,0 +1,9 @@
+#!/bin/bash -xv
+
+for db in support ransim_db
+do
+ mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};"
+ mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;"
+done
+
+mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;"