This file provides guidance to the AI agent when working with code in this repository.
A Docker image (PHP CLI Alpine + S6 Overlay v3) for running webman apps. No application code lives here: the app is mounted at /app, entrypoint.sh auto-runs composer install if vendor/autoload.php is missing, then S6 starts the webman longrun service (config/s6-rc.d/webman/, command from WEBMAN_CMD env, default php start.php start) on port 8787.
docker build -t tinywan/docker-php-webman:<PHP-version>-cli-alpine .β image tag must match theFROM php:X.Y.Z-cli-alpinebase.- Smoke test:
docker run --rm -it -p 8787:8787 -v <webman-app-dir>:/app <image>.
- Shell scripts must have LF endings.
extension/install.shfails with CRLF ("line 1: #!/bin/sh: not found"); the Dockerfile guards withsed -i 's/\r$//' install.shβ keep that line. - Installed extensions are controlled by the comma-delimited
EXTENSIONS=",..."string atextension/install.sh:12, not the individual install blocks below it. Add/remove extensions in that string. extension/*.tgzare vendored sources compiled at build time; the redis/swoole/event/xlswriter ones are currently unused fallbacks since those installs moved to PIE. PECL's REST API is decommissioned β keep builds working without it. When bumping the PHP base image, updateFROM, the LABEL description, README, and extension versions together.- Online extension installs use PIE (
installExtensionFromPie, vendoredextension/pie.phar1.4.9): redis (phpredis/phpredis), event (osmanov/pecl-event), swoole (swoole/swoole), xlswriter (viest/xlswriter), plus dormant blocks (imagick, rar, ast, varnish, mcrypt, memcached β₯3, yaf, rdkafka). Remainingpecl installcalls (psr, msgpack, igbinary, yac, yar, yaconf, seaslog, pdo_sqlsrv, sqlsrv, zookeeper, phalcon) have no PIE package yet. - PIE quirks: it sometimes skips auto-enabling (pecl-event) β the helper falls back to
docker-php-ext-enable; event's ini must be renamed toevent.iniso it loads AFTER sockets (needs sockets' symbols); PIE 1.4.x has no configure-options flag, so swoole relies on auto-detection (openssl yes, sockets support unverified). - Extension runtime libs must stay explicit in the Dockerfile runtime
apk addline (libstdc++for swoole,libzipfor zip,libeventfor event):apk del .build-depsotherwise purges them along with their-devcounterparts and the extensions silently stop loading. The Dockerfile has a post-cleanupphp -r extension_loaded(...)gate β when changingEXTENSIONS, update that list too. - S6 service files live in
config/s6-rc.d/;webmanmust stay registered via the empty markerconfig/s6-rc.d/user/contents.d/webman. Like all scripts here, therunfile needs LF endings (the Dockerfile also strips\ras a guard). - S6 overlay tarballs are vendored in
overlay/(only thex86_64one); the image effectively builds amd64-only despite QEMU in CI. To support more arches, vendor the matching tarball and update the COPY line.
- Images publish via CI only (
.github/workflows/docker-publish.yml) onv*.*.*git tags, to Docker Hub + GHCR. Each release pushes three tags: the semver version,latest, and<php-version>-cli-alpine(extracted from the DockerfileFROMline β keep that line format intact). Don't push images manually. - Commit style is short, often just the new image tag (e.g.
8.5.9-cli-alpine); feature branches usefeature/<name>merged tomainvia PR.