diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..4de8215caa0e70a36063e9db402a832617fb0470 --- /dev/null +++ b/Dockerfile @@ -0,0 +1 @@ +FROM mariadb:10.5.8 diff --git a/README.md b/README.md index 5cd101ae2699087507e73da99007479863e384cd..9860babeda6613d9da3f0652b886b173a80134f9 100644 --- a/README.md +++ b/README.md @@ -1 +1,23 @@ # FaaS-DB + +## structure +`_conf/`_ - directory with configuration files +`scripts/` - directory with utils and scripts + +## build image +To build `faas-db` docker image +` +cd scripts +./build.sh +` + + +## run image +To run `faas-db` docker image +` +cd scripts +./run.sh +` + + + diff --git a/conf/faas-db.cnf b/conf/faas-db.cnf new file mode 100644 index 0000000000000000000000000000000000000000..ab58617555eb4e04f94163056527aae5c6f7708e --- /dev/null +++ b/conf/faas-db.cnf @@ -0,0 +1,6 @@ +FAAS_DB_IMAGE=faas/faas-db:1.0-SNAPSHOT +FAAS_DB_VOLUME_VAR_LIB_MYSQL=/tmp/faas-db +FAAS_DB_PORT=8306 + +# TODO - remove to external resource +FAAS_DB_ROOT_PASSWORD=secure diff --git a/conf/faas-db.compose.yml b/conf/faas-db.compose.yml new file mode 100644 index 0000000000000000000000000000000000000000..a1823743eacdb4a879063087b95020900962450a --- /dev/null +++ b/conf/faas-db.compose.yml @@ -0,0 +1,15 @@ +version: '3.1' + +services: + db: + image: ${FAAS_DB_IMAGE} + build: + context: ../ + dockerfile: Dockerfile + restart: always + environment: + MYSQL_ROOT_PASSWORD: ${FAAS_DB_ROOT_PASSWORD} + volumes: + - ${FAAS_DB_VOLUME_VAR_LIB_MYSQL}:/var/lib/mysql + ports: + - "${FAAS_DB_PORT}:3306" diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index 9ef58039db6db7f8cb75bdc7868181a8eb8fdb45..0000000000000000000000000000000000000000 --- a/docker/Dockerfile +++ /dev/null @@ -1 +0,0 @@ -FROM mysql:8.0.22 diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..b1c82a0584e7dfe466d51944ffe0c88be800b085 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +docker-compose --env-file ../conf/faas-db.cnf -f ../conf/faas-db.compose.yml build diff --git a/scripts/faas-mysql.build b/scripts/faas-mysql.build deleted file mode 100755 index 5f4039c14fada13b3260946ae68bd50d07fa3dc6..0000000000000000000000000000000000000000 --- a/scripts/faas-mysql.build +++ /dev/null @@ -1,3 +0,0 @@ -#! /bin/bash - -docker build ../docker -t faas/faas-db:1.0-SNAPSHOT diff --git a/scripts/run.sh b/scripts/run.sh new file mode 100755 index 0000000000000000000000000000000000000000..38268c8b8324327032cd6f2cebcee2411594fdd5 --- /dev/null +++ b/scripts/run.sh @@ -0,0 +1,3 @@ +#! /bin/bash + +docker-compose --env-file ../conf/faas-db.cnf -f ../conf/faas-db.compose.yml up