Skip to content

Maintenance: Dockerfile, GHCR workflow, bug fixes, install docs - #24

Merged
overcuriousity merged 1 commit into
mainfrom
maintenance-2026-07
Jul 16, 2026
Merged

overcuriousity merged 1 commit into
mainfrom
maintenance-2026-07

Conversation

@overcuriousity

@overcuriousity overcuriousity commented Jul 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add CPU-only Dockerfile, .dockerignore, and a GHCR publish workflow triggered on version tags — closes [feature request] Have released docker container version. #22
  • Document system header packages needed when Pillow builds from source on Python 3.14 — closes Missing C header files can break installation process #23
  • Fix XML escaping: title/authors on the cover page and TOC entries in TOC.xhtml/toc.ncx were interpolated unescaped, so a & or < in a title produced an invalid EPUB
  • Use torch.backends.mps.is_available() (stable since torch 1.12) instead of torch.mps.is_available()
  • Fix opening the markdown review file on macOS (open) and Windows (os.startfile; start is 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.0 pin (dependabot PR #21 closed for that reason).

Test plan

  • python -m compileall and ruff check --select E9,F . pass (same as CI)
  • XML escaping verified with &/< in title and chapter names

🤖 Generated with Claude Code

https://claude.ai/code/session_01TceCbVKCf5V8bjjXy7yUYz

Summary by CodeRabbit

  • New Features

    • Added Docker support for building and running the application in a CPU-only container.
    • Added automated Docker image publishing for version tags.
    • Added documentation for Docker usage and required Debian/Ubuntu image libraries.
  • Bug Fixes

    • Improved Apple Silicon hardware detection.
    • Improved EPUB compatibility and handling of special characters.
    • Added platform-specific support for opening generated markdown files.

- 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
@coderabbitai

coderabbitai Bot commented Jul 16, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

Container distribution

Layer / File(s) Summary
Container image packaging
.dockerignore, Dockerfile, README.md, .gitignore
Docker build inputs, runtime paths, model caching, mounted PDF usage, and related ignore rules are configured and documented.
GHCR publishing workflow
.github/workflows/docker.yml
Version-tag and manual workflow runs build and publish metadata-tagged images to GHCR.

Runtime and EPUB portability

Layer / File(s) Summary
Installation and device guidance
README.md, main.py
Linux Pillow prerequisites are documented, and Apple Silicon availability uses torch.backends.mps.is_available().
Portable EPUB generation and markdown review
modules/mark2epub.py
Markdown files open through platform-specific commands, and generated cover and table-of-contents text is XML-escaped.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR also includes unrelated XML escaping, MPS detection, markdown opener, and ignore-file changes beyond #22/#23. Split the unrelated fixes into a separate PR or justify them in the linked issues, and keep this PR focused on Docker release and install docs.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and reflects the main changes: Docker/GHCR release support plus docs and bug fixes.
Linked Issues check ✅ Passed The Dockerfile, GHCR workflow, and README install guidance satisfy #22 and #23.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch maintenance-2026-07

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
.github/workflows/docker.yml (1)

33-39: 🚀 Performance & Scalability | 🔵 Trivial

Consider enabling multi-architecture builds for the GHCR image.

Currently, this workflow only builds the image for linux/amd64 (the default architecture for ubuntu-latest runners). 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/arm64 image 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

📥 Commits

Reviewing files that changed from the base of the PR and between ba29c22 and 4e2c27a.

📒 Files selected for processing (7)
  • .dockerignore
  • .github/workflows/docker.yml
  • .gitignore
  • Dockerfile
  • README.md
  • main.py
  • modules/mark2epub.py

@overcuriousity
overcuriousity merged commit 5eae669 into main Jul 16, 2026
5 checks passed
@overcuriousity
overcuriousity deleted the maintenance-2026-07 branch July 16, 2026 18:17
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.

Missing C header files can break installation process [feature request] Have released docker container version.

1 participant