Skip to content

Bake Flarum into the image and seed the volume from it (#2) - #5

Merged
karl-bullock merged 2 commits into
mainfrom
bake-skeleton
Jul 29, 2026
Merged

Bake Flarum into the image and seed the volume from it (#2)#5
karl-bullock merged 2 commits into
mainfrom
bake-skeleton

Conversation

@karl-bullock

Copy link
Copy Markdown
Member

The image now contains Flarum. Until this PR the Dockerfile had zero references to flarum/flarum — it was a PHP runtime that downloaded a forum when a container first started.

Build time

Resolves from the committed lock. Build-time network is fine and reproducible; the lock decides what gets installed.

create-project --no-install supplies the skeleton's own files (index.php, the flarum CLI, public/, storage/) — those belong to the flarum/flarum package and never appear in vendor/, so composer install alone would not produce a working root. --no-install skips its resolution because the committed lock replaces its composer.json immediately after.

The build fails if the FLARUM_VERSION ARG and the lock disagree about flarum/core. The ARG picks the package supplying the root files, the lock picks everything else, and nothing else would notice them drifting apart.

First boot

An empty volume is seeded by copying the baked skeleton. Nothing is fetched — the six extensions are already in the skeleton's composer.json, so the existing composer_require calls short-circuit as "already present". That makes a fresh install fully offline.

TARGET_FLARUM_VERSION becomes the deliberate opt-out: setting it means "resolve from Packagist instead", the old behaviour, still supported. Images built before the skeleton existed take that path automatically, since the guard tests for the directory.

Deliberately not in scope

An existing volume is untouched, exactly as today. Whether a running forum should adopt a new skeleton on image update is the open question in #2 and is not decided here — this PR is the fresh-install half, which is where the value is and which has no ambiguity.

What proves it

roundtrip builds the image, installs a forum from scratch, plants a marker, backs it up, destroys the volumes and restores. If seeding from the skeleton were wrong in any way, a fresh install would not come up and that job fails.

The image now contains Flarum. Until this commit the Dockerfile had zero
references to flarum/flarum: it was a PHP runtime that downloaded a forum
when a container first started, at ^2.0 with beta stability plus six
extensions at bare '*'. Seven floating constraints, so the same tag could
produce different forums a week apart, and there was no offline install.

Build time resolves from the committed lock, which is fine and
reproducible — the lock decides. create-project supplies the skeleton's
own files (index.php, the flarum CLI, public/, storage/) since those
belong to the flarum/flarum package and never appear in vendor/;
--no-install skips its resolution because the committed lock replaces its
composer.json immediately after. The build fails if the ARG and the lock
disagree about flarum/core, because nothing else would notice them
drifting apart.

First boot with an empty volume copies that skeleton in. Nothing is
fetched: the six extensions are already in the skeleton's composer.json,
so the existing composer_require calls short-circuit as "already
present". Setting TARGET_FLARUM_VERSION is now the deliberate opt-out —
it means "resolve this from Packagist instead", the old behaviour, still
supported. Images built before the skeleton existed take that path
automatically, since the guard tests for the directory.

An existing volume is untouched, exactly as before. Whether a running
forum should adopt a new skeleton on image update is a separate decision
and deliberately not made here.
roundtrip passing proved nothing about where Flarum came from. The
runner has network, so the old Packagist path satisfies every check in
the job just as well as the baked one — the pin could stop being
load-bearing and the suite would stay green.

Now it reads the container log and fails if the fresh install did not
seed from the skeleton, or if it resolved over the network at all.
@karl-bullock
karl-bullock merged commit b94a9c1 into main Jul 29, 2026
6 checks passed
@karl-bullock
karl-bullock deleted the bake-skeleton branch July 29, 2026 02:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant