├── Dockerfile ├── README.md ├── supervisord.conf └── webgrind.nginx.conf /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu 2 | MAINTAINER Christian Lück 3 | 4 | RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \ 5 | nginx supervisor php5-fpm php5-cli \ 6 | graphviz python \ 7 | git 8 | 9 | # add webgrind as the only nginx site 10 | ADD webgrind.nginx.conf /etc/nginx/sites-available/webgrind 11 | RUN ln -s /etc/nginx/sites-available/webgrind /etc/nginx/sites-enabled/webgrind 12 | RUN rm /etc/nginx/sites-enabled/default 13 | 14 | # install webgrind from git 15 | RUN git clone https://github.com/jokkedk/webgrind /var/www 16 | RUN chown www-data:www-data -R /var/www 17 | 18 | # expose only nginx HTTP port 19 | EXPOSE 80 20 | 21 | # expose default directory where we look for cachegrind files 22 | VOLUME /tmp 23 | 24 | ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf 25 | CMD supervisord -c /etc/supervisor/conf.d/supervisord.conf 26 | 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-webgrind 2 | 3 | [Webgrind](https://github.com/jokkedk/webgrind) is a [Xdebug](http://www.xdebug.org) 4 | profiling web frontend in PHP5. It implements a subset of the features of [kcachegrind](http://kcachegrind.sourceforge.net/cgi-bin/show.cgi). 5 | This is a [docker](https://www.docker.io) image that eases setup. 6 | 7 | [![](http://jokke.dk/media/2008-webgrind/webgrind_small.png)](http://jokke.dk/media/2008-webgrind/webgrind_large.png) 8 | 9 | ## Usage 10 | 11 | This docker image is available as a [trusted build on the docker index](https://index.docker.io/u/clue/webgrind/). 12 | Using this image for the first time will start a download automatically. 13 | Further runs will be immediate, as the image will be cached locally. 14 | 15 | The recommended way to run this container looks like this: 16 | 17 | ```bash 18 | $ docker run -d -p 80:80 clue/webgrind 19 | ``` 20 | 21 | This will start the webgrind container in a detached session in the background and will expose 22 | its HTTP port. So you can now browse to: 23 | 24 | http://localhost/ 25 | 26 | This container is disposable, as it doesn't store any sensitive information at all. 27 | If you don't need it anymore, you can `stop` and `remove` it. 28 | -------------------------------------------------------------------------------- /supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | 4 | [program:php5-fpm] 5 | command=/usr/sbin/php5-fpm --nodaemonize 6 | 7 | [program:nginx] 8 | command=/usr/sbin/nginx -g "daemon off;" 9 | 10 | -------------------------------------------------------------------------------- /webgrind.nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | root /var/www; 4 | 5 | index index.php index.html; 6 | 7 | location / { 8 | try_files $uri $uri/ =404; 9 | } 10 | 11 | location ~ \.php$ { 12 | fastcgi_split_path_info ^(.+\.php)(/.+)$; 13 | fastcgi_pass unix:/var/run/php5-fpm.sock; 14 | fastcgi_index index.php; 15 | include fastcgi_params; 16 | } 17 | } 18 | 19 | --------------------------------------------------------------------------------