summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgios Andreadis <g.andreadis@student.tudelft.nl>2018-02-15 23:21:27 +0100
committerGeorgios Andreadis <g.andreadis@student.tudelft.nl>2018-02-15 23:21:27 +0100
commit3ea328d01eb17b0321d658c32cf858d1313d9249 (patch)
treebdbfb8325f382139aab9eaf6ce88a7939b0d25d0
parent2212162c1311ce9b39cb2142f52bffddac3b9559 (diff)
parentb6875e16b1683f86226449d577a8c98b04d70915 (diff)
Merge branch 'chore/database-schema' into 'master'
chore: Automatically import database schema in Docker image See merge request opendc/opendc!13
-rw-r--r--database/Dockerfile8
-rw-r--r--docker-compose.yml4
2 files changed, 11 insertions, 1 deletions
diff --git a/database/Dockerfile b/database/Dockerfile
new file mode 100644
index 00000000..0e933b40
--- /dev/null
+++ b/database/Dockerfile
@@ -0,0 +1,8 @@
+FROM mariadb:10.1
+MAINTAINER Fabian Mastenbroek <f.s.mastenbroek@student.tudelft.nl>
+
+# Import schema into database
+ADD schema.sql /docker-entrypoint-initdb.d
+
+# Add test data into database
+ADD test.sql /docker-entrypoint-initdb.d
diff --git a/docker-compose.yml b/docker-compose.yml
index d9a73ad2..a89b7260 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -29,7 +29,9 @@ services:
- PERSISTENCE_USER=opendc
- PERSISTENCE_PASSWORD=opendcpassword
mariadb:
- image: mariadb:10.1
+ build:
+ context: ./database
+ image: database
restart: on-failure
ports:
- "3306:3306" # comment this line out in production