Sign inSign up

tuimedia/base

By tuimedia

•Updated 3 days ago

PHP 8 FPM, nginx or caddy, supervisor, netcat, and a few other common essentials

Image
0

100K+

tuimedia/base repository overview

⁠Alpine-Profiler

This Docker image extends :alpine-official to add XHProf profiler⁠. It actually uses an experminental fork of XHProf⁠ that works on PHP7.

⁠Usage

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:

  • named name.type.xhprof
  • name must a hexadecimal digit that returns true when passed to ctype_xdigit
  • type must be present
  • The name and type must be separated by a dot
  • The file extension must be xhprof
⁠Using the XHProf UI

There 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/⁠

Tag summary

Content type

Image

Digest

sha256:e9472bf49…

Size

162.2 MB

Last updated

3 days ago

docker pull tuimedia/base:caddy-symfony-php84