From 515f79fd9c93702b0d705830784b46090736324d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Menrath?= Date: Tue, 24 Sep 2024 10:23:31 +0200 Subject: [PATCH] enable xdebug on integration test imagae --- Dockerfile | 13 ++++++++++++- docker-compose.yml | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 56e97a7..d2203ef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,18 @@ RUN apk update \ RUN docker-php-ext-install mysqli -# Install Composer +# Install Xdebug +RUN apk add --no-cache $PHPIZE_DEPS \ + && apk add --update linux-headers \ + && pecl install xdebug \ + && docker-php-ext-enable xdebug \ + && apk del --purge $PHPIZE_DEPS \ + && echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ + && echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ + && echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ + && echo "xdebug.idekey=VSCODE" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini + +# Install Composer RUN EXPECTED_CHECKSUM=$(curl -s https://composer.github.io/installer.sig) \ && curl https://getcomposer.org/installer -o composer-setup.php \ && ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" \ diff --git a/docker-compose.yml b/docker-compose.yml index 9a4085b..0536ad4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,3 +29,5 @@ services: volumes: - .:/app command: ["composer", "run-script", "test"] + extra_hosts: + - "host.docker.internal:host-gateway"