From 2d0d7c89fbf8bdce8d4c5d3a2f2ef7ecfce87712 Mon Sep 17 00:00:00 2001 From: Dale Davies Date: Tue, 19 Jul 2022 12:24:20 +0100 Subject: [PATCH] Add support for profiling via xdebug --- .gitignore | 1 + Dockerfile-xdebug | 3 +++ docker/entrypoint.sh | 4 ++++ docker/xdebug.ini | 6 ++++-- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 0975f3b..076418c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /node_modules +/xdebug */vendor docker-compose.yaml \ No newline at end of file diff --git a/Dockerfile-xdebug b/Dockerfile-xdebug index d9898cf..584e7a7 100644 --- a/Dockerfile-xdebug +++ b/Dockerfile-xdebug @@ -62,6 +62,9 @@ RUN mkdir -p /var/www/cache/application \ /var/www/cache/application \ && chmod +x /usr/local/bin/entrypoint.sh +RUN mkdir -p /tmp/xdebug \ + && chown -R jumpapp:jumpapp /tmp/xdebug + # Expose the port we configured for nginx. EXPOSE 8080 diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index b55c7ed..e0c1847 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -64,6 +64,10 @@ if [ -z "${DEVELOPMENT-}" ]; then echo >&2 ""; echo >&2 "-------------------------------------------------------------" echo >&2 ""; + +else + echo >&2 "- Setting correct ownership of xdebug dir" + chown -R jumpapp:jumpapp /tmp/xdebug fi php-fpm8 diff --git a/docker/xdebug.ini b/docker/xdebug.ini index 497ec15..d6cbe65 100644 --- a/docker/xdebug.ini +++ b/docker/xdebug.ini @@ -1,6 +1,8 @@ zend_extension=xdebug.so -xdebug.mode=debug +xdebug.mode=debug,profile xdebug.discover_client_host = true xdebug.start_with_request=trigger -xdebug.log="/tmp/xdebug.log" \ No newline at end of file +xdebug.log="/tmp/xdebug.log" +xdebug.output_dir="/tmp/xdebug" +xdebug.profiler_output_name = %s.%R.%p.%r \ No newline at end of file