A Docker image that contains the PHP SPX extension, which can be used to view PHP profiling data.

Setup

docker-compose-spx.yml
Copied!
version: "3.8"

services:
  nginx-spx:
    image: wodby/nginx:1.19
    environment:
      NGINX_VHOST_PRESET: php
      NGINX_BACKEND_HOST: spx
      NGINX_SERVER_ROOT: /var/www/html/public
    ports:
      - 8000:80
    volumes:
      - app:/var/www/html

  spx:
    image: ghcr.io/nedix/spx-docker:8.2
    volumes:
      - app:/var/www/html
    depends_on:
      - nginx-spx

volumes:
  app:
    driver: local
    driver_opts:
      device: ${PWD}
      o: bind
      type: none

Usage

Step 1.

Start the containers:

docker compose -f docker-compose.yml -f docker-compose-spx.yml up -d
Copied!

Step 2.

Navigate to your page on localhost:8000 to capture the profiling data.

Step 3.

Find SPX on localhost:8000/?SPX_UI_URI=/&SPX_KEY=dev.