Commit 48ccb6db authored by Dariusz Janny's avatar Dariusz Janny
Browse files

[faas#28] moving secrets to separate env file.

parent 79596304
......@@ -3,6 +3,11 @@ config ?= conf/faas-db.cnf
include $(config)
export $(shell sed 's/=.*//' $(config))
credentials ?= conf/credentials/faas-db-default.cnf
include $(credentials)
export $(shell sed 's/=.*//' $(credentials))
export FAAS_DB_IMAGE=${FAAS_DB_REPO}/${FAAS_DB_NAME}:${FAAS_DB_VERSION}
.DEFAULT_GOAL := help
......@@ -16,10 +21,10 @@ build-nc: # build container without caching
docker build --no-cache -t ${FAAS_DB_IMAGE} --build-arg FAAS_DB_NAME=${FAAS_DB_NAME} --build-arg FAAS_DB_IMAGE=${FAAS_DB_IMAGE} --build-arg FAAS_DB_VERSION=${FAAS_DB_VERSION} .
run: # run container
docker run -i -t --detach --rm --env-file=$(config) -p=${FAAS_DB_PORT}:3306 --name="${FAAS_DB_NAME}" -v ${FAAS_DB_VOLUME_VAR_LIB_MYSQL}:/var/lib/mysql ${FAAS_DB_IMAGE}
docker run -i -t --detach --rm --env-file=$(config) --env-file=$(credentials) -p=${FAAS_DB_PORT}:3306 --name="${FAAS_DB_NAME}" -v ${FAAS_DB_VOLUME_VAR_LIB_MYSQL}:/var/lib/mysql ${FAAS_DB_IMAGE}
run-nd: # run container in no-deamon mode
docker run -i -t --rm --env-file=$(config) -p=${FAAS_DB_PORT}:3306 --name="${FAAS_DB_NAME}" -v ${FAAS_DB_VOLUME_VAR_LIB_MYSQL}:/var/lib/mysql ${FAAS_DB_IMAGE}
docker run -i -t --env-file=$(config) --env-file=$(credentials) --rm -p=${FAAS_DB_PORT}:3306 --name="${FAAS_DB_NAME}" -v ${FAAS_DB_VOLUME_VAR_LIB_MYSQL}:/var/lib/mysql ${FAAS_DB_IMAGE}
up: build run # build and run container
......
MYSQL_ROOT_PASSWORD=changeme
\ No newline at end of file
......@@ -2,10 +2,5 @@ FAAS_DB_REPO=faas
FAAS_DB_VERSION=1.0-SNAPSHOT
FAAS_DB_NAME=faas-db
FAAS_DB_IMAGE=${FAAS_DB_REPO}/${FAAS_DB_NAME}:${FAAS_DB_VERSION}
FAAS_DB_VOLUME_VAR_LIB_MYSQL=/tmp/faas-db
FAAS_DB_PORT=8306
# TODO - remove to external resource
MYSQL_ROOT_PASSWORD=secure
FAAS_DB_PORT=9306
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment