doc-en
doc-en copied to clipboard
Add a Docker Compose setup for building and serving PHP documentation locally
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.