Skip to content

Commit

Permalink
add build argument to build script
Browse files Browse the repository at this point in the history
add XDEBUG_IDE_KEY
correct build php-fpm xdebug
  • Loading branch information
Wolvverine committed May 25, 2024
1 parent b0a13f4 commit 87cc165
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
9 changes: 5 additions & 4 deletions Dockerfile_nginx-82
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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="$( \
Expand All @@ -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 ;
Expand Down
1 change: 1 addition & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand Down
2 changes: 1 addition & 1 deletion docker-entrypoint.d/10phpfpm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Empty file modified docker_login.sh
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ####################################################################
Expand Down
5 changes: 3 additions & 2 deletions root/etc/php-fpm.d/xdebug.conf.j2
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -15,4 +15,5 @@ xdebug.auto_trace = off
xdebug.collect_assignments = on
xdebug.collect_return = on
xdebug.collect_vars = on
xdebug.dump_undefined = on
xdebug.dump_undefined = on
xdebug.idekey = {{ env('PHPFPM_XDEBUG_IDE_KEY') }}
Empty file modified run.sh
100644 → 100755
Empty file.

0 comments on commit 87cc165

Please sign in to comment.