Skip to content

Commit

Permalink
NOPUSH: xdebug profiling
Browse files Browse the repository at this point in the history
  • Loading branch information
hemberger committed Dec 2, 2018
1 parent e1d2201 commit bc5630c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 8 additions & 0 deletions config/php/xdebug.sample.ini
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ services:
depends_on:
- mysql
- smtp
- webgrind
volumes:
# Mount the source code instead of copying it.
- ./admin:/smr/admin
- ./engine:/smr/engine
- ./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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit bc5630c

Please sign in to comment.