diff --git a/hack/tfw_magic_start.sh b/hack/tfw_magic_start.sh index b52a33d..5949ae2 100755 --- a/hack/tfw_magic_start.sh +++ b/hack/tfw_magic_start.sh @@ -32,15 +32,25 @@ build_baseimage() docker build -t "${BASEIMAGE_NAME}:${VERSION}-${DATE}" . } -run_backend() +build_backend() { cd $BACKEND_PATH docker build -t $IMAGE_NAME -f ${BUILD_CONTEXT}/Dockerfile --build-arg BUILD_CONTEXT=$BUILD_CONTEXT --build-arg NOFRONTEND=1 . +} + +run_backend() +{ docker run --rm -p $BACKEND_PORT:$BACKEND_PORT -e AVATAO_SECRET=$AVATAO_SECRET $IMAGE_NAME } +build_and_run_backend() +{ + build_backend + run_backend +} + trap 'exit' INT TERM trap 'kill 0' EXIT build_baseimage -run_frontend & run_backend +run_frontend & build_and_run_backend wait