diff --git a/Dockerfile_nginx-82 b/Dockerfile_nginx-82 index eadf2f3..93c99f8 100644 --- a/Dockerfile_nginx-82 +++ b/Dockerfile_nginx-82 @@ -26,6 +26,7 @@ ENV GLPI_CHMOD_PATHS_FILES no ENV GLPI_INSTALL_PLUGINS '' ENV PHP_XDEBUG "${PHP_XDEBUG}" +ENV PHPFPM_XDEBUG_IDE_KEY Docker ENV PHP_UPLOAD_MAX_FILESIZE 16m ENV PHP_MAX_EXECUTION_TIME 3600 @@ -104,10 +105,10 @@ RUN set -ex; \ ; \ pecl install apcu && docker-php-ext-enable apcu ; \ pecl install xmlrpc-1.0.0RC3 && docker-php-ext-enable xmlrpc ; \ - if [[ "$PHP_XDEBUG" = "yes" ]] ; then \ + if [ "$PHP_XDEBUG" = "yes" ] ; then \ pecl install xdebug-3.3.2 && docker-php-ext-enable xdebug ; \ else \ - echo "PHP_XDEBUG is not build - set $PHP_XDEBUG" ; \ + echo "PHP_XDEBUG is not build - set PHP_XDEBUG to yes." ; \ fi ; \ docker-php-source delete ; \ runDeps="$( \ @@ -130,8 +131,8 @@ RUN rm -f /usr/local/etc/php-fpm.conf COPY --from=build_glpi --chown=www-data:www-data ${GLPI_PATHS_ROOT} ${GLPI_PATHS_ROOT} # Add some configurations files -RUN if [[ "$PHP_XDEBUG" = "yes" ]] ; then \ - echo "Xdebug is on"; \ +RUN if [ "$PHP_XDEBUG" = "yes" ] ; then \ + echo "Xdebug is enabled - PHP_XDEBUG=$PHP_XDEBUG"; \ else \ rm -f root\etc\php-fpm.d\xdebug.conf.j2 ; \ fi ; diff --git a/build.sh b/build.sh index db8bae0..5d24c68 100755 --- a/build.sh +++ b/build.sh @@ -53,6 +53,7 @@ echo "-> use image name '${image_building_name}' for build" ## Build image echo "=> building '${image_building_name}' with image version '${image_version}'" docker build --build-arg "GLPI_VERSION=${GLPI_VERSION}" \ + --build-arg "PHP_XDEBUG=${PHP_XDEBUG}" \ --label "org.label-schema.build-date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ --label 'org.label-schema.name=glpi' \ --label 'org.label-schema.description=GLPI web application' \ diff --git a/docker-entrypoint.d/10phpfpm b/docker-entrypoint.d/10phpfpm index 5ce5d3e..c7e7cd9 100644 --- a/docker-entrypoint.d/10phpfpm +++ b/docker-entrypoint.d/10phpfpm @@ -6,6 +6,6 @@ jinjanate /etc/php-fpm.d/nginx.conf.j2 -o /usr/local/etc/php-fpm.d/zzz-nginx.con jinjanate /etc/php-fpm.d/custom.conf.j2 -o /usr/local/etc/php-fpm.d/zzz-tuning.conf # to lowercase PHP_XDEBUG=$(echo "${PHP_XDEBUG}" | tr '[:upper:]' '[:lower:]') -if [ "${PHP_XDEBUG}" = "yes" ]; then +if [ "${PHP_XDEBUG}" = "yes" ]; then jinjanate /etc/php-fpm.d/xdebug.conf.j2 -o /usr/local/etc/php-fpm.d/xdebug-config.conf fi \ No newline at end of file diff --git a/docker_login.sh b/docker_login.sh old mode 100644 new mode 100755 diff --git a/install scripts/install_upgrade_glpi_with_mariadb_docker_developers.cmd b/install scripts/install_upgrade_glpi_with_mariadb_docker_developers.cmd index 2c37126..74dc811 100644 --- a/install scripts/install_upgrade_glpi_with_mariadb_docker_developers.cmd +++ b/install scripts/install_upgrade_glpi_with_mariadb_docker_developers.cmd @@ -33,6 +33,7 @@ REM Enter your PORT where you are listening SET XDEBUG_CLIENT_PORT=9003 REM Enter your IP where you are listening SET XDEBUG_CLIENT_HOST=host.docker.internal +SET PHPFPM_XDEBUG_IDE_KEY=Docker REM #################################################################### diff --git a/root/etc/php-fpm.d/xdebug.conf.j2 b/root/etc/php-fpm.d/xdebug.conf.j2 index 7cb4989..29b2a89 100644 --- a/root/etc/php-fpm.d/xdebug.conf.j2 +++ b/root/etc/php-fpm.d/xdebug.conf.j2 @@ -1,6 +1,6 @@ zend_extension=xdebug extension=xdebug.so -xdebug.log=/proc/1/fd/2 +xdebug.log=/proc/self/fd/2 xdebug.start_with_request=yes xdebug.mode=debug xdebug.discover_client_host=0 @@ -15,4 +15,5 @@ xdebug.auto_trace = off xdebug.collect_assignments = on xdebug.collect_return = on xdebug.collect_vars = on -xdebug.dump_undefined = on \ No newline at end of file +xdebug.dump_undefined = on +xdebug.idekey = {{ env('PHPFPM_XDEBUG_IDE_KEY') }} diff --git a/run.sh b/run.sh old mode 100644 new mode 100755