gateway: deploy config.yaml changes (the volume was shadowing the image)

Deploying the audio-pricing change proved the gap: the image built and the app
restarted, but /model/info still served the old prices — /app/data is a
persistent volume, so the Dockerfile's COPY config.yaml /app/data/config.yaml is
shadowed by the volume's file from the first install, and start.sh only wrote a
default when the file was missing. Config changes in this repo therefore never
reached a running gateway; the audit's byte-identical md5 check was a manual
sync.

Fix: ship a second copy at /app/code/config.yaml and have start.sh sync it over
the volume at boot whenever they differ. The repo stays the source of truth, the
legacy first-boot default remains, and the README documents the flow.
This commit is contained in:
Ubuntu committed 2026-10-26 21:17:41 +00:00
1 parent 425d738625
commit facf01d578
3 files changed
+22

No files matched your search

+11
View File
@@ -150,6 +150,17 @@ YAML
echo "Config written to $CONFIG_FILE"
fi
# --- Ship config updates with the image ---
# /app/data is a persistent volume, so the copy the Dockerfile bakes into
# /app/data/config.yaml is shadowed by the volume's file forever — config
# changes in the repo would never reach a running gateway. The repo is the
# source of truth (README: repos mirror production), so sync the shipped copy
# over the volume whenever they differ.
if [ -f /app/code/config.yaml ] && ! cmp -s /app/code/config.yaml "$CONFIG_FILE"; then
echo "Updating /app/data/config.yaml from the image (repo is the source of truth)"
cp /app/code/config.yaml "$CONFIG_FILE"
fi
# --- Start LiteLLM ---
echo "Starting LiteLLM on port 4000..."