mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 12:25:22 +00:00
add tenant mode support in docker container:
This commit is contained in:
parent
7c6adf17aa
commit
738bbaad30
2 changed files with 21 additions and 10 deletions
|
|
@ -73,6 +73,8 @@ ARG SOURCEBOT_VERSION=unknown
|
|||
ENV SOURCEBOT_VERSION=$SOURCEBOT_VERSION
|
||||
RUN echo "Sourcebot Version: $SOURCEBOT_VERSION"
|
||||
|
||||
ENV SOURCEBOT_TENANT_MODE=single
|
||||
|
||||
# Valid values are: debug, info, warn, error
|
||||
ENV SOURCEBOT_LOG_LEVEL=info
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,15 @@ fi
|
|||
|
||||
echo "{\"version\": \"$SOURCEBOT_VERSION\", \"install_id\": \"$SOURCEBOT_INSTALL_ID\"}" > "$FIRST_RUN_FILE"
|
||||
|
||||
# Fallback to sample config if a config does not exist
|
||||
if [ ! -z "$SOURCEBOT_TENANT_MODE" ]; then
|
||||
echo -e "\e[34m[Info] Sourcebot tenant mode: $SOURCEBOT_TENANT_MODE\e[0m"
|
||||
else
|
||||
echo -e "\e[31m[Error] SOURCEBOT_TENANT_MODE is not set.\e[0m"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# If we're in single tenant mode, fallback to sample config if a config does not exist
|
||||
if [ "$SOURCEBOT_TENANT_MODE" = "single" ]; then
|
||||
if echo "$CONFIG_PATH" | grep -qE '^https?://'; then
|
||||
if ! curl --output /dev/null --silent --head --fail "$CONFIG_PATH"; then
|
||||
echo -e "\e[33m[Warning] Remote config file at '$CONFIG_PATH' not found. Falling back on sample config.\e[0m"
|
||||
|
|
@ -80,6 +88,7 @@ elif [ ! -f "$CONFIG_PATH" ]; then
|
|||
fi
|
||||
|
||||
echo -e "\e[34m[Info] Using config file at: '$CONFIG_PATH'.\e[0m"
|
||||
fi
|
||||
|
||||
# Update NextJs public env variables w/o requiring a rebuild.
|
||||
# @see: https://phase.dev/blog/nextjs-public-runtime-variables/
|
||||
|
|
|
|||
Loading…
Reference in a new issue