From 92b0b9e1db880a1fed89d42454ba20caf8ef5d52 Mon Sep 17 00:00:00 2001 From: justusbunsi Date: Sun, 22 May 2022 11:12:11 +0200 Subject: [PATCH] Add config path environment to Docker image Signed-off-by: Steven Kriegler --- Dockerfile | 1 + README.md | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/Dockerfile b/Dockerfile index c91dd76..93bf360 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,6 +40,7 @@ ENV HOME=/home/bot EXPOSE 3000 ENV GIN_MODE "release" +ENV GITEA_SQ_BOT_CONFIG_PATH "/home/bot/config/config.yaml" VOLUME ["/home/bot/config/"] RUN ["chmod", "+x", "/usr/local/bin/docker-entrypoint.sh"] diff --git a/README.md b/README.md index 7507ed6..efb8c47 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,19 @@ and execute the following (replace `$TAG` first): docker run --rm -it -p 9000:3000 -v "$(pwd)/config/:/home/bot/config/" justusbunsi/gitea-sonarqube-bot:$TAG ``` +**Starting with v0.2.0** + +By default, the bot expects its configuration file under `./config/config.yaml` next to the bot executable. Inside the Docker image the +corresponding full path is `/home/bot/config/config.yaml`. If you prefer using a different location or even a different filename, you can +also define the environment variable `GITEA_SQ_BOT_CONFIG_PATH` that allows for changing that full path. + +Imagine having a `./config/sqbot.config.yml` on your host that you want to populate inside `/mnt/`, the correct command to run a Docker +container would be: + +```bash +docker run --rm -it -p 9000:3000 -e "GITEA_SQ_BOT_CONFIG_PATH=/mnt/sqbot.config.yml" -v "$(pwd)/config/:/mnt/" justusbunsi/gitea-sonarqube-bot:$TAG +``` + ### Helm Chart See [Helm Chart README](helm/README.md) for detailed instructions.