From b31eeec04aadded32a4d30c9958b0fa3b9b0963c Mon Sep 17 00:00:00 2001 From: Mike Lynch Date: Fri, 26 Jul 2019 14:46:34 +1000 Subject: [PATCH] Added util scripts for development --- attach.sh | 4 ++++ logs.sh | 6 ++++++ stop.sh | 6 ++++++ up.sh | 8 ++++++++ 4 files changed, 24 insertions(+) create mode 100755 attach.sh create mode 100755 logs.sh create mode 100755 stop.sh create mode 100755 up.sh diff --git a/attach.sh b/attach.sh new file mode 100755 index 0000000..8642c1c --- /dev/null +++ b/attach.sh @@ -0,0 +1,4 @@ +#! /bin/sh +#Attach a shell to nginx +NGINX_PS=$(docker ps -f name=ocflmount -q) +docker exec -it $NGINX_PS /bin/bash -c 'exec "${SHELL:-sh}"' diff --git a/logs.sh b/logs.sh new file mode 100755 index 0000000..98ea90f --- /dev/null +++ b/logs.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# Follow logs + +NGINX_PS=$(docker ps -f name=ocflmount -q) +docker container logs -f $NGINX_PS diff --git a/stop.sh b/stop.sh new file mode 100755 index 0000000..6addb43 --- /dev/null +++ b/stop.sh @@ -0,0 +1,6 @@ +#! /bin/sh +# stop and remove the ocflmount container + +NGINX_PS=$(docker ps -f name=ocflmount -q) +docker stop $NGINX_PS +docker rm $NGINX_PS \ No newline at end of file diff --git a/up.sh b/up.sh new file mode 100755 index 0000000..75607e6 --- /dev/null +++ b/up.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +OCFL_DIR=/Users/mike/working/redbox/ocfl-nginx/test_repos/ + +docker run -d --name ocflmount \ + --mount type=bind,source=${OCFL_DIR},target=/etc/share/nginx/html \ + -p 8080:8080 \ + $1