🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
fix(ai-gateway): retain build revision in runtime image (#17503)
Hassieb Pakzad1b986aec8fd2
diff --git a/ai-gateway/Dockerfile b/ai-gateway/Dockerfileindex 25b7491895..c82ae0571f 100644--- a/ai-gateway/Dockerfile+++ b/ai-gateway/Dockerfile@@ -11,6 +11,8 @@ FROM debian:bookworm-slim AS runtimeRUN apt-get update && apt-get install -y --no-install-recommends ca-certificates wget \&& rm -rf /var/lib/apt/lists/*COPY --from=builder /app/target/release/ai-gateway /usr/local/bin/ai-gateway+ARG BUILD_ID+ENV BUILD_ID=$BUILD_IDUSER 10001:10001EXPOSE 8080STOPSIGNAL SIGTERMdiff --git a/ai-gateway/README.md b/ai-gateway/README.mdindex cce2022dac..acac378690 100644--- a/ai-gateway/README.md+++ b/ai-gateway/README.md@@ -337,7 +337,9 @@ key metadata remain in Langfuse ingestion and are excluded from operational logsFrom the repository root:```sh-docker build --target runtime -t langfuse-ai-gateway:dev ./ai-gateway+docker build --target runtime \+ --build-arg BUILD_ID="$(git rev-parse HEAD)" \+ -t langfuse-ai-gateway:dev ./ai-gatewaydocker run --rm --name langfuse-ai-gateway-dev \-e LANGFUSE_LOG_FORMAT=json -p 127.0.0.1:8080:8080 langfuse-ai-gateway:dev# In another terminal:@@ -345,6 +347,10 @@ docker stop --time 15 langfuse-ai-gateway-devbash ai-gateway/scripts/smoke-image.sh langfuse-ai-gateway:dev```+The `BUILD_ID` build argument is stored as runtime `BUILD_ID`, so operational+telemetry identifies the built commit. Omit the build argument to use the Cargo+package version, or override `BUILD_ID` at runtime.+The runtime image runs as UID/GID 10001, includes CA certificates, and executesthe binary directly so it receives signals. Set the container/orchestrator stopgrace period longer than the gateway shutdown timeout. The smoke test uses an