diff --git a/Dockerfile b/Dockerfile index 9aa6b7168..55f8bd3f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,6 +47,11 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local COPY composer.json . RUN composer install --no-interaction +# Xdebug +RUN pecl install xdebug \ + && docker-php-ext-enable xdebug +RUN mkdir /tmp/xdebug && chown www-data /tmp/xdebug + COPY --from=builder /smr . RUN rm -rf /var/www/html/ && ln -s "$(pwd)/htdocs" /var/www/html diff --git a/config/php/xdebug.sample.ini b/config/php/xdebug.sample.ini new file mode 100644 index 000000000..c2bbae72b --- /dev/null +++ b/config/php/xdebug.sample.ini @@ -0,0 +1,8 @@ +xdebug.profiler_enable = 1 +xdebug.profiler_output_dir = "/tmp/xdebug/" +xdebug.profiler_aggregate = 1 + +xdebug.force_display_errors = 1 + +; Disable @ (shut-up) operator +xdebug.scream = 0 diff --git a/docker-compose.yml b/docker-compose.yml index 3e10aeffb..3267f5086 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -31,6 +31,7 @@ services: depends_on: - mysql - smtp + - webgrind volumes: # Mount the source code instead of copying it. - ./admin:/smr/admin @@ -38,6 +39,9 @@ services: - ./htdocs:/smr/htdocs - ./lib:/smr/lib - ./templates:/smr/templates + # Output and Config files for Xdebug + - ./xdebug:/tmp/xdebug + - ./config/php/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini smtp: image: hemberger/postfix-relay @@ -128,6 +132,14 @@ services: - /var/run/docker.sock:/var/run/docker.sock - portainer_data:/data + webgrind: + image: devgeniem/webgrind + ports: + - 8082:80 + volumes: + - ./xdebug:/tmp/xdebug + - .:/smr:ro + # We want persistent, anonymous data volumes volumes: smr_upload: