Maintenance: Dockerfile, GHCR workflow, bug fixes, install docs - #24
Conversation
- Add CPU-only Dockerfile, .dockerignore, and a GHCR publish workflow triggered on version tags (closes #22) - Document the system header packages needed when Pillow builds from source on Python 3.14 (closes #23) - Escape title/authors in the cover page and TOC entries in TOC.xhtml/ toc.ncx; unescaped '&' or '<' produced invalid XHTML - Use torch.backends.mps.is_available() (available since torch 1.12) instead of torch.mps.is_available() - Fix opening the markdown file for review on macOS (open) and Windows (os.startfile; 'start' is not an executable) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TceCbVKCf5V8bjjXy7yUYz
📝 WalkthroughWalkthroughThe pull request adds CPU-only Docker packaging and GHCR publishing, documents Linux image-library prerequisites and Docker usage, corrects Apple Silicon detection, and improves cross-platform markdown opening plus XML escaping in generated EPUB content. ChangesContainer distribution
Runtime and EPUB portability
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant GitHubActions
participant DockerMetadata
participant DockerBuild
participant GHCR
GitHubActions->>DockerMetadata: Generate image tags and labels
DockerMetadata->>DockerBuild: Supply metadata
DockerBuild->>GHCR: Build and push Docker image
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/docker.yml (1)
33-39: 🚀 Performance & Scalability | 🔵 TrivialConsider enabling multi-architecture builds for the GHCR image.
Currently, this workflow only builds the image for
linux/amd64(the default architecture forubuntu-latestrunners). If users on Apple Silicon or ARM Linux pull the published GHCR image, it will run via emulation (e.g., Rosetta 2), which incurs a severe performance penalty—especially for CPU-bound tasks like processing PDFs.Consider setting up Docker Buildx and QEMU to publish a multi-arch image, so users get a native
linux/arm64image automatically when they pull.💡 Example multi-arch setup
- name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build and push uses: docker/build-push-action@v6 with: context: . push: true platforms: linux/amd64,linux/arm64 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In @.github/workflows/docker.yml around lines 33 - 39, Update the Docker workflow around the “Build and push” step to initialize QEMU and Docker Buildx, then configure docker/build-push-action to publish both linux/amd64 and linux/arm64 images while preserving the existing tags, labels, context, and push behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In @.github/workflows/docker.yml:
- Around line 33-39: Update the Docker workflow around the “Build and push” step
to initialize QEMU and Docker Buildx, then configure docker/build-push-action to
publish both linux/amd64 and linux/arm64 images while preserving the existing
tags, labels, context, and push behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 980d451d-8760-4eeb-b479-5d663fba69c3
📒 Files selected for processing (7)
.dockerignore.github/workflows/docker.yml.gitignoreDockerfileREADME.mdmain.pymodules/mark2epub.py
Summary
&or<in a title produced an invalid EPUBtorch.backends.mps.is_available()(stable since torch 1.12) instead oftorch.mps.is_available()open) and Windows (os.startfile;startis not an executable)Dependency status
All pinned deps already at newest compatible versions. transformers 5.x is blocked by marker-pdf's
transformers<5.0.0pin (dependabot PR #21 closed for that reason).Test plan
python -m compileallandruff check --select E9,F .pass (same as CI)&/<in title and chapter names🤖 Generated with Claude Code
https://claude.ai/code/session_01TceCbVKCf5V8bjjXy7yUYz
Summary by CodeRabbit
New Features
Bug Fixes