chore: add Docker containerization for local development and testing #5718
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.
What does it do?
Adds Docker containerization support for Hexo’s core repository to simplify local development, testing, and CI consistency.
Currently, Hexo requires manual Node.js setup (>=20.19.0). This PR introduces a standardized Docker environment allowing contributors to build, serve, and test Hexo inside an isolated container — reducing setup friction and ensuring consistent builds across systems.
Solution
Introduced a minimal
Dockerfile(based on Node 20 Alpine) and an optionaldocker-compose.ymlfor quick startup.The image installs dependencies, builds the project, and can run either the development server or test suite.
Key Highlights:
node:20-alpinebase (aligns with Hexo 8+ requirements)hexo serverChanges Made
Dockerfile: Added Node 20 Alpine image for reproducible environmentdocker-compose.yml: Added for quick setup and local testingPull request tasks
hexo serverfunctionalityTesting
✅ Verified that Hexo builds and serves locally using Docker
✅
hexo generateandhexo serverrun successfully inside container✅ Compatible with Node.js 20 and Alpine environment
✅ No impact on existing development workflow
Example Usage