1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-20 20:51:50 +01:00

docker: enable profiling with xdebug

This commit is contained in:
Zankaria 2024-04-12 17:10:19 +02:00 committed by Zankaria
parent fb191a0ffd
commit 5c99b0f4f3
4 changed files with 33 additions and 1 deletions

View File

@ -21,11 +21,12 @@ services:
php:
build:
context: .
dockerfile: ./docker/php/Dockerfile
dockerfile: ./docker/php/Dockerfile.profile
volumes:
- ./local-www:/var/www
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
- ./docker/php/jit.ini:/usr/local/etc/php/conf.d/jit.ini
- ./docker/php/xdebug-prof.ini:/usr/local/etc/php/conf.d/xdebug-prof.ini
networks:
vichan_net:
ipv4_address: 172.20.0.4

View File

@ -0,0 +1,16 @@
# syntax = devthefuture/dockerfile-x
INCLUDE ./docker/php/Dockerfile
RUN apk add --no-cache \
linux-headers \
$PHPIZE_DEPS \
&& pecl update-channels \
&& pecl install xdebug \
&& docker-php-ext-enable xdebug \
&& apk del \
linux-headers \
$PHPIZE_DEPS \
&& rm -rf /var/cache/*
ENV XDEBUG_OUT_DIR=/var/www/xdebug_out
CMD [ "bootstrap.sh" ]

View File

@ -24,6 +24,14 @@ if [ ! -w /var/www ] ; then
exit 1
fi
if [ -z "$XDEBUG_OUT_DIR" ] ; then
echo "INFO: Initializing xdebug out directory at $XDEBUG_OUT_DIR"
mkdir -p "$XDEBUG_OUT_DIR"
chown www-data "$XDEBUG_OUT_DIR"
chgrp www-data "$XDEBUG_OUT_DIR"
chmod 755 "$XDEBUG_OUT_DIR"
fi
# Link the entrypoints from the exposed directory.
ln -nfs \
/code/tools/ \

View File

@ -0,0 +1,7 @@
zend_extension=xdebug
[xdebug]
xdebug.mode = profile
xdebug.start_with_request = start
error_reporting = E_ALL
xdebug.output_dir = /var/www/xdebug_out