From 2f0448513f37f7ccf6657dbe0d4cb19e7510df9a Mon Sep 17 00:00:00 2001 From: Filip Izydorczyk Date: Mon, 24 Aug 2020 10:18:42 +0200 Subject: [PATCH] Auto database creating --- init.sql | 1 + stack.yml | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 init.sql diff --git a/init.sql b/init.sql new file mode 100644 index 0000000..beb60b6 --- /dev/null +++ b/init.sql @@ -0,0 +1 @@ +CREATE DATABASE IF NOT EXISTS test; \ No newline at end of file diff --git a/stack.yml b/stack.yml index 933c7ba..7d1516c 100644 --- a/stack.yml +++ b/stack.yml @@ -5,6 +5,9 @@ services: db: image: mariadb restart: always + command: --init-file /data/application/init.sql + volumes: + - ./init.sql:/data/application/init.sql environment: MYSQL_ROOT_PASSWORD: example expose: