Bake MyBB into Docker image at build time instead of runtime #1
+139
−497
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fundamentally changes how MyBB is delivered in the Docker image. Instead of downloading MyBB at container startup (runtime), MyBB is now pre-installed into the image at build time. This improves reliability, security, and deployment consistency.
Key Changes
Dockerfile: Added build-time MyBB installation that downloads and extracts MyBB during image build, storing it in
/opt/mybb-source. MadeMYBB_VERSIONa required build argument.GitHub Actions Workflow:
mybb_versioninput required for manual buildsLATEST_MYBB_VERSIONenvironment variable for consistencybuild-versionsmatrix to only build the 2 latest MyBB versions (1838, 1839) to reduce maintenance burdenEntrypoint Script:
.mybb_versionfiles in both image and volumeDocker Compose Files:
docker-compose.yml: Now usesMYBB_VERSIONas a build argument (local development)docker-compose.ghcr.yml: UsesMYBB_TAGto select pre-built image versions; removed runtimeMYBB_VERSIONenv varDocumentation:
env.examplewith clearer configuration guidanceImplementation Details
/opt/mybb-sourceduring build and copied to/var/www/htmlat container startup.mybb_versionfiles to detect mismatches between image and installed versionsBenefits
✅ Reliability: No runtime downloads means faster startup and no network failures during container initialization
✅ Security: MyBB source is verified at build time, not downloaded at runtime
✅ Consistency: Every container from the same image has identical MyBB files
✅ Simplicity: Clearer separation between build-time and runtime concerns
✅ Maintainability: Reduced scope by focusing on 2 latest versions for pre-built images
https://claude.ai/code/session_017iViynCSN8iwn6NiUetwsp