From 9380bf2753b0001cee6bea34c95896b5bda56fc2 Mon Sep 17 00:00:00 2001 From: Rajat Ahuja Date: Tue, 25 Aug 2026 17:35:04 -0400 Subject: [PATCH] fix(docker): ship pyproject.toml in the runtime image (#1074) The runtime stage copies application code but not pyproject.toml, so src/_version.py cannot find the file it reads the version from. The image also installs dependencies with --no-install-project, so there is no honcho distribution for the importlib.metadata fallback to find. Both lookups fail, so the service falls back to reporting its version as "unknown" in the OpenAPI schema and in telemetry events. Copying the file into the runtime stage restores an accurate version. The file is under 4 KB, so the image size is unchanged. Co-authored-by: Claude Opus 5 (1M context) --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 8fd9be47..00ce1485 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,6 +63,9 @@ COPY --chown=app:app migrations/ /app/migrations/ COPY --chown=app:app scripts/ /app/scripts/ COPY --chown=app:app docker/ /app/docker/ COPY --chown=app:app alembic.ini /app/alembic.ini +# src/_version.py reads the service version from here at runtime, so this +# is a runtime input as well as a build input. +COPY --chown=app:app pyproject.toml /app/pyproject.toml # Copy config files - this will copy config.toml if it exists, and config.toml.example COPY --chown=app:app config.toml* /app/