PHP 8 FPM, nginx or caddy, supervisor, netcat, and a few other common essentials
100K+
This Docker image extends :alpine-official to add XHProf profiler.
It actually uses an experminental fork of XHProf that works on PHP7.
Use it in place of :alpine-official when you want profiling.
Add the following when you want to start profiling your code:
xhprof_enable(XHPROF_FLAGS_MEMORY + XHPROF_FLAGS_CPU);
Add the following when you want to stop profiling:
$name = time();
$type = "my-app-1";
$filename = "/var/www/profiles/$name.hub9.xhprof";
file_put_contents($filename, serialize(xhprof_disable()));`
I recommend you mount the profiles directory on your host. Ie, in your docker-compose:
app:
image: tuimedia/base:alpine-profiler
volumes:
- ./profiles:/var/www/profiles
A note about naming: the XHProf UI is a piece of shit, but it works.
To use XHProf UI the profiles must be:
name.type.xhprofname must a hexadecimal digit that returns true when passed to ctype_xdigittype must be presentThere are a lot of UIs for XHProf. The simplest (hah) to setup is the UI included in XHProf. See https://hub.docker.com/r/tuimedia/xhprof-docker/
Content type
Image
Digest
sha256:e9472bf49…
Size
162.2 MB
Last updated
3 days ago
docker pull tuimedia/base:caddy-symfony-php84