Keep source bind mounts out of a recreated supervisor container (#227)

The supervisor on evo had a bind mount of an old source copy over the
image's /app sources. The deploy carried every mount over when it
recreated the container, so a rebuilt image never took effect and the
fix for missing bot networks stayed inactive. Mounts into /app are now
dropped; data and Docker socket mounts are kept.


Claude-Session: https://claude.ai/code/session_01QAiXRe1FLMAJT9jkvwFZFq

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
cynarAI 2026-10-23 10:34:43 +02:00 committed by GitHub
parent 679b90a667
commit f11be8735c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View File

@ -496,7 +496,7 @@ refresh_supervisor_container() {
return 0
fi
local work image network restart retries line
local work image network restart retries line target
work="$(mktemp -d)"
image="$(docker container inspect -f '{{.Config.Image}}' "$name")"
network="$(docker container inspect -f '{{.HostConfig.NetworkMode}}' "$name")"
@ -509,8 +509,11 @@ refresh_supervisor_container() {
elif [[ -n "$restart" && "$restart" != no ]]; then
args+=(--restart "$restart")
fi
# A bind mount over the image's /app would shadow the freshly built sources, so it is not carried over.
while IFS= read -r line; do
[[ -n "$line" ]] && args+=(-v "$line")
target="${line%:ro}"
target="${target##*:}"
[[ -n "$line" && "$target" != /app && "$target" != /app/* ]] && args+=(-v "$line")
done < <(docker container inspect -f \
'{{range .Mounts}}{{if eq .Type "volume"}}{{.Name}}{{else}}{{.Source}}{{end}}:{{.Destination}}{{if not .RW}}:ro{{end}}{{"\n"}}{{end}}' "$name")
while IFS= read -r line; do

View File

@ -212,7 +212,7 @@ if [[ "$1 $2" == "container inspect" ]]; then
*NetworkMode*) echo host ;;
*RestartPolicy.Name*) echo unless-stopped ;;
*MaximumRetryCount*) echo 0 ;;
*Mounts*) printf '/srv/data:/srv/data\\n/var/run/docker.sock:/var/run/docker.sock\\n' ;;
*Mounts*) printf '/srv/data:/srv/data\\n/var/run/docker.sock:/var/run/docker.sock\\n/srv/old-src:/app/infra/sandboxes/supervisor/src\\n' ;;
*Config.Env*) printf 'DATA_DIR=/srv/data\\nPATH=/usr/bin\\nSUPERVISOR_PORT=7091\\n' ;;
esac
exit 0