]> BookStack Code Mirror - bookstack/commitdiff
chore(dev): add xdebug support for docker setup
authorjulesdevops <redacted>
Sat, 22 Jan 2022 16:37:06 +0000 (17:37 +0100)
committerjulesdevops <redacted>
Sat, 22 Jan 2022 16:43:29 +0000 (17:43 +0100)
dev/docker/Dockerfile
dev/docker/php/conf.d/xdebug.ini [new file with mode: 0644]
docker-compose.yml

index 178ea9a6c865481f40d07529de0915d86553152e..b1bf93349e5af64c238dc197be2cf65a96d4b7f9 100644 (file)
@@ -8,6 +8,8 @@ RUN apt-get update -y \
     && apt-get install -y git zip unzip libpng-dev libldap2-dev libzip-dev wait-for-it \
     && docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
     && docker-php-ext-install pdo_mysql gd ldap zip \
+    && pecl install xdebug \
+    && docker-php-ext-enable xdebug \
     && a2enmod rewrite \
     && sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
     && sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
diff --git a/dev/docker/php/conf.d/xdebug.ini b/dev/docker/php/conf.d/xdebug.ini
new file mode 100644 (file)
index 0000000..8eaad61
--- /dev/null
@@ -0,0 +1,7 @@
+zend_extension=xdebug
+
+[xdebug]
+xdebug.mode=debug
+xdebug.client_host=host.docker.internal
+xdebug.start_with_request=yes
+xdebug.client_port=9090
\ No newline at end of file
index 7920258944694e6b0d1af757ba9fd3bef5b45e57..13648c12176463301a7835c70ec35205741c335e 100644 (file)
@@ -38,7 +38,10 @@ services:
       - ${DEV_PORT:-8080}:80
     volumes:
       - ./:/app
+      - ./dev/docker/php/conf.d/xdebug.ini:/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
     entrypoint: /app/dev/docker/entrypoint.app.sh
+    extra_hosts:
+    - "host.docker.internal:host-gateway"
   node:
     image: node:alpine
     working_dir: /app