Skip to content

Commit

Permalink
add xdebug by default, enable it on demand
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix-bjoern committed Feb 19, 2025
1 parent 8cfe932 commit 3bce887
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
12 changes: 4 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,15 @@ RUN apk --no-cache add \
postfix \
unzip

# Install PHP extensions
# Install and configure PHP extensions
RUN apk --no-cache add --virtual .build-deps \
freetype-dev icu-dev zlib-dev libjpeg-turbo-dev libpng-dev libxml2-dev libxslt-dev libzip-dev linux-headers \
freetype-dev icu-dev zlib-dev libjpeg-turbo-dev libpng-dev libxml2-dev libxslt-dev libzip-dev linux-headers $PHPIZE_DEPS\
&& docker-php-ext-configure \
gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ \
&& docker-php-ext-install -j$(nproc) $PHP_EXTENSIONS \
&& apk del .build-deps

# Install PECL extensions
RUN apk --no-cache add --virtual .build-deps $PHPIZE_DEPS \
&& pecl install apcu redis lzf zstd \
&& pecl install apcu redis lzf xdebug zstd \
&& docker-php-ext-enable apcu redis lzf zstd \
&& mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
&& apk del .build-deps

# Configure nginx and postfix
Expand All @@ -55,7 +52,6 @@ RUN addgroup nginx postdrop \
&& sed -ie "s#include /etc/nginx/http.d/#include /etc/nginx/conf.d/#g" /etc/nginx/nginx.conf \
&& postconf "smtputf8_enable = no" && postconf "maillog_file=/var/log/postfix/mail.log" \
&& chown nginx:nginx /var/www/html \
&& mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
&& ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log

Expand Down
3 changes: 0 additions & 3 deletions bin/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,6 @@ if [ ! -z "$XDEBUG_INSTALL" ] && [ ! -f /.deployed_xdebug ]; then
echo -e "zend_extension=xdebug.so\nxdebug.mode=debug,profile\nxdebug.client_host=$XDEBUG_REMOTE_HOST\nxdebug.client_port=9000\nxdebug.start_with_request=trigger\nxdebug.output_dir=/var/www/html/var\nxdebug.max_nesting_level=500\n" > /usr/local/etc/php/conf.d/zz-xdebug-settings.ini
echo -e "export XDEBUG_SESSION=\"$XDEBUG_IDE_KEY\"" >> /root/.bashrc
fi
apk --no-cache add --virtual .build-deps linux-headers $PHPIZE_DEPS \
&& pecl install xdebug \
&& apk del .build-deps
touch /.deployed_xdebug
fi

Expand Down

0 comments on commit 3bce887

Please sign in to comment.