From 6a5fde94c228454e949a2fb164bf53aea18b62f7 Mon Sep 17 00:00:00 2001 From: Dirk Heilig Date: Thu, 26 Sep 2024 11:21:07 +0200 Subject: [PATCH] make repository url an runtime env var --- Dockerfile | 1 - starter | 9 +++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ad94571..76fd9c5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,5 +17,4 @@ ADD starter /usr/local/bin/ EXPOSE 80 WORKDIR /repo -RUN git clone "$GIT_URL" . CMD /usr/local/bin/starter \ No newline at end of file diff --git a/starter b/starter index 5ceaf86..29fa2a1 100755 --- a/starter +++ b/starter @@ -25,8 +25,17 @@ function update() { rm -rf /var/www/html-delme & git reset --hard } +function init() { + test -z "$GIT_URL" && { + echo "GIT_URL is not set" + exit 1 + } + git clone "$GIT_URL" . +} cd /repo + +init update ( while true; do