Skip to content

Automattic/wordpress-xdebug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

Wordpress and XDebug Docker image

Usage

Use the environment variable XDEBUG_CONFIG tu configure the XDebug PHP extension.

Docker Compose

Example configuration file docker-compose.yml:

version: '3.3'

services:
  db:
    image: docker.io/bitnami/mariadb:10.3-debian-10
    restart: on-failure
    environment:
      MARIADB_USER: wordpress
      MARIADB_PASSWORD: wordpress
      MARIADB_ROOT_PASSWORD: wordpress
      MARIADB_DATABASE: wordpress

  wp:
    depends_on:
    - db
    image: automattic/wordpress-xdebug
    volumes:
    - ./wp:/var/www/html
    ports:
    - 8080:80
    restart: on-failure
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress

Usage with VSCode

To use XDebug in VSCode you need the PHP Debug extension.

You also need to make VSCode map the paths on the container to the ones on the host, you have to set the pathMappings settings in your launch.json.

Example configuration file .vscode/launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Listen for XDebug",
      "type": "php",
      "request": "launch",
      "port": 9000,
      "pathMappings": {
        "/var/www/html": "${workspaceRoot}/wp",
      }
    }
  ]
}

Docker Hub

Published as automattic/wordpress-xdebug in Docker Hub.

How to publish a new build on Docker Hub

  1. Create a Pull Request bumping the version in Dockerfile for the wordpress image tag on Automattic/wordpress-xdebug to get a new build done automatically. See latest builds of automattic/wordpress-xdebug here.
  2. Merge the PR (if you're an Automattician)
  3. Using GitHub's Interface, create a release pointing to master and with the release tag matching the version you justed bumped to in the Dockerfile. e.g. so it reads FROM wordpress:5.6.1. image
  4. That's it, now automattic/wordpress-xdebug:latest and automattic/wordpress-xdebug:5.6.1 will both refer to the new build based on the wordpress:5.6.1 tag.

License

GPL v2

Based on previous work from andreccosta/wordpress-xdebug