Add initial xdebug support

Enable using `XDEBUG_MODE=debug docker compose up`.
This commit is contained in:
Oliver Davies 2024-05-01 23:21:43 +01:00
parent d6f8b29065
commit 4138112e4c
3 changed files with 8 additions and 9 deletions

View file

@ -32,10 +32,14 @@ RUN apt-get update -yqq \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man \ && rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man \
&& apt-get clean && apt-get clean
RUN pecl install xdebug
RUN docker-php-ext-configure gd --with-jpeg RUN docker-php-ext-configure gd --with-jpeg
RUN docker-php-ext-install gd pdo_mysql zip RUN docker-php-ext-install gd pdo_mysql zip
RUN docker-php-ext-enable xdebug
COPY --chown=app:app phpunit.xml* ./ COPY --chown=app:app phpunit.xml* ./

View file

@ -1,8 +1,6 @@
services: services:
php-fpm: php:
environment:
XDEBUG_MODE: ${XDEBUG_MODE:-off}
extra_hosts: extra_hosts:
- "host.docker.internal:host-gateway" host.docker.internal: host-gateway
web:
ports:
- "80:80"

View file

@ -1,6 +1,3 @@
xdebug.mode=develop,debug
xdebug.client_host=host.docker.internal xdebug.client_host=host.docker.internal
xdebug.discover_client_host=0 xdebug.discover_client_host=0
xdebug.output_dir=/tmp/xdebug
xdebug.log=/tmp/xdebug/xdebug-docker-drupal-example.log
xdebug.start_with_request=yes xdebug.start_with_request=yes