From 6b3f60c7d6d096e312f2a5d89695ed7a8228a4b6 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Thu, 15 Oct 2026 23:38:06 +0200 Subject: [PATCH] fix(docker): ship versions.json in production image Closes #11868 Co-Authored-By: Claude Opus 5.5 --- docker/production/Dockerfile | 2 ++ tests/Unit/ProductionImageWorkflowTest.php | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/docker/production/Dockerfile b/docker/production/Dockerfile index 9f2f5c55b4..46d5c40c4a 100644 --- a/docker/production/Dockerfile +++ b/docker/production/Dockerfile @@ -183,6 +183,8 @@ COPY --chown=www-data:www-data resources/views ./resources/views COPY --chown=www-data:www-data artisan artisan COPY --chown=www-data:www-data openapi.yaml ./openapi.yaml COPY --chown=www-data:www-data changelogs/ ./changelogs/ +# Version data for Traefik, Sentinel, and helper checks until CheckForUpdatesJob refreshes it +COPY --chown=www-data:www-data versions.json ./versions.json RUN composer dump-autoload diff --git a/tests/Unit/ProductionImageWorkflowTest.php b/tests/Unit/ProductionImageWorkflowTest.php index 7be4d80802..98adac798b 100644 --- a/tests/Unit/ProductionImageWorkflowTest.php +++ b/tests/Unit/ProductionImageWorkflowTest.php @@ -222,3 +222,13 @@ it('guides issue authors to the correct contribution branch', function () { ->toContain('Feature code should branch from `next` and target `next`') ->toContain('Small fixes should target `main`; larger changes should target `next`'); }); + +it('ships versions.json in the production image so version checks work right after an upgrade', function () { + $dockerfile = file_get_contents(dirname(__DIR__, 2).'/docker/production/Dockerfile'); + $dockerignore = file_get_contents(dirname(__DIR__, 2).'/.dockerignore'); + + expect($dockerfile) + ->toContain('COPY --chown=www-data:www-data versions.json ./versions.json') + ->and($dockerignore) + ->not->toMatch('/^\/?versions\.json$/m'); +});