Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

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

Andras Bacsai6b3f60c7d6d0
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');
+});