fix(docker): ship versions.json in production image

Closes #11868

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2026-10-15 23:38:06 +02:00
co-authored by Claude Opus 5.5
parent 12fd9e448b
commit 6b3f60c7d6
2 changed files with 12 additions and 0 deletions
+2
View File
@@ -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
@@ -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');
});