2020-11-13 10:26:44 +00:00
|
|
|
FROM php:7.4-fpm-alpine
|
2019-07-09 14:27:13 +00:00
|
|
|
|
|
|
|
# php configuration
|
|
|
|
COPY php.ini /usr/local/etc/php/
|
|
|
|
|
|
|
|
# install the xhprof extension to profile requests
|
2020-11-13 10:26:44 +00:00
|
|
|
RUN curl "https://github.com/tideways/php-xhprof-extension/archive/v5.0.2.tar.gz" -fsL -o ./php-xhprof-extension.tar.gz && \
|
2019-07-09 14:27:13 +00:00
|
|
|
tar xf ./php-xhprof-extension.tar.gz && \
|
2020-11-13 10:26:44 +00:00
|
|
|
cd php-xhprof-extension-5.0.2 && \
|
2019-07-09 14:27:13 +00:00
|
|
|
apk add --update --no-cache build-base autoconf && \
|
|
|
|
phpize && \
|
|
|
|
./configure && \
|
|
|
|
make && \
|
|
|
|
make install
|
2020-11-13 10:26:44 +00:00
|
|
|
RUN rm -rf ./php-xhprof-extension.tar.gz ./php-xhprof-extension-5.0.2
|
|
|
|
RUN docker-php-ext-enable tideways_xhprof
|
2019-07-09 14:27:13 +00:00
|
|
|
|
|
|
|
# install mongodb extension. The xhgui-collector will send xprof data to mongo
|
|
|
|
RUN apk add --no-cache autoconf alpine-sdk
|
|
|
|
RUN pecl install mongodb && docker-php-ext-enable mongodb
|
|
|
|
|
2020-11-13 10:26:44 +00:00
|
|
|
# install composer
|
|
|
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
|
|
|
|
|
|
# install the package that will collect data
|
|
|
|
WORKDIR /var/xhgui
|
|
|
|
RUN composer require perftools/php-profiler perftools/xhgui-collector alcaeus/mongo-php-adapter
|
|
|
|
|
|
|
|
# copy the configuration file
|
|
|
|
COPY xhgui_config.php /var/xhgui/config/config.php
|