Skip to content

Conversation

@lacatoire
Copy link

Description

This PR adds a simple Docker Compose workflow to build and preview the PHP manual locally.
It provides a lightweight, cross-platform alternative to the existing make setup and works on Linux, macOS, and Windows (including PowerShell).

The goal is to make contributing to the documentation easier for new and existing contributors by removing installation steps and dependency issues.

Highlights

  • Uses PhD inside a clean Docker environment
  • Default language is English (en), but others can be built easily:
    • Linux/macOS: LANGUAGE=fr docker compose up --build
    • PowerShell: $env:LANGUAGE="fr"; docker compose up --build
  • Output format (e.g. xhtml, php-chunked-xhtml) can be changed in the compose.yaml file
  • Automatically handles CRLF normalization on Windows

Technical notes

  • Based on php:8.2-cli-alpine for stability and minimal dependencies.
  • PHP 8.3 and 8.4 were skipped to avoid compatibility issues with the PhD toolchain.
  • FrankenPHP was considered for serving the output but would add unnecessary complexity the built-in PHP server is enough here.

Does not modify the existing make build process this is an optional, self-contained alternative.

Impact

This setup should lower the barrier to entry for contributors and make it easier to test translations and improvements locally, without manual setup.

@Girgias Girgias requested a review from afilina November 4, 2025 06:04
Copy link
Contributor

@afilina afilina left a comment

Choose a reason for hiding this comment

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

I like this workflow a lot. Merci!

I followed the instructions for default and fr on both Linux and PowerShell. Everything behaves as expected. I left some usability and other suggestions in the review comments.

Future improvement ideas (I can open issues once this is merged, and we can have discussions about each item at that time):

  • Ask whether the user wants to clone missing dependencies.
  • Remove the previous docker-based workflow.

@lacatoire lacatoire requested a review from afilina November 5, 2025 07:06
Copy link
Contributor

@afilina afilina left a comment

Choose a reason for hiding this comment

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

Thanks for incorporating the suggestions. Just the directory check that doesn't seem to behave as expected. See details in the comment.

Comment on lines +19 to +20
if [ ! -d "$DIR" ]; then
echo "❌ Missing required directory: $DIR"
Copy link
Contributor

Choose a reason for hiding this comment

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

I wasn't able to hit this line even when I had no directories. It's checking them after the volumes are mounted, so there's always a folder, just empty.

I always get "✅ All prerequisites found." and then it crashes later.

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.

2 participants