forked from jerome-breton/xhprof-simple-profiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
34 lines (28 loc) · 927 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM php:7.0-apache
#Install Graphviz (dot binary is used to display graphs)
# and build extension essentials
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -yq install graphviz git && \
apt-get autoremove --assume-yes && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN git clone https://github.com/tideways/php-xhprof-extension.git && \
( \
cd php-xhprof-extension && \
phpize && \
./configure && \
make -j$(nproc) && \
make install \
) && \
docker-php-ext-enable tideways_xhprof
#Set www-data uid/gid to the host owner uid/gid (generally 1000:1000)
RUN usermod -u 1000 www-data
RUN groupmod -g 1000 www-data
#Setup ENV variables
ENV PROFILER_PATH='/traces'
ENV PROFILER_SUFFIX='xhprof'
#Copy app in container
COPY ./html /var/www/html/
COPY ./lib /var/www/lib/
#This is where you should link your XHProf traces
VOLUME ["/var/www/traces"]