fix(docker): preserve explicit config selectors during bootstrap

Only initialize the Compose default instance when no --config/-c selector is present. Preserve all CLI-supported selector spellings and cover gateway/API startup against selected persisted settings in the Docker smoke test.
This commit is contained in:
chengyongru authored and chengyongru committed 2026-10-19 13:02:26 +08:00
1 parent b079522fa1
commit 103840171b
3 files changed
+62 -4

No files matched your search

+12 -3
View File
@@ -43,9 +43,18 @@ if [ "$RENDER" = "true" ]; then
fi
set -- "$@" --config "$config"
elif [ "$NANOBOT_DOCKER_BOOTSTRAP" = "1" ] && { [ "$1" = "gateway" ] || [ "$1" = "serve" ]; }; then
config="$dir/config.json"
python -m nanobot.cli.docker_bootstrap "$config" || exit 1
set -- "$@" --config "$config"
# Explicit config selectors belong to the CLI; bootstrap only the default instance.
initialize_default=1
for argument in "$@"; do
case "$argument" in
--config|--config=*|-c*) initialize_default=0; break ;;
esac
done
if [ "$initialize_default" = "1" ]; then
config="$dir/config.json"
python -m nanobot.cli.docker_bootstrap "$config" || exit 1
set -- "$@" --config "$config"
fi
fi
exec nanobot "$@"