diff --git a/webkit/Dockerfile b/webkit/Dockerfile index 82ea3ff..8cca756 100644 --- a/webkit/Dockerfile +++ b/webkit/Dockerfile @@ -6,7 +6,7 @@ FROM ubuntu:14.04 MAINTAINER kev RUN apt-get update && apt-get install -y supervisor haproxy libfontconfig1 libfreetype6 -RUN mkdir -p /webkit/includes/ /etc/supervisor/conf.d/ /etc/monit/conf.d/ /var/lib/monit/events/ +RUN mkdir -p /data/ /webkit/includes/ /etc/supervisor/conf.d/ /etc/monit/conf.d/ /var/lib/monit/events/ ADD ./*.js /webkit/ ADD ./includes/ /webkit/includes/ @@ -19,6 +19,7 @@ ADD ./monit/conf.d/ /etc/monit/conf.d/ RUN chmod 600 /etc/monit/monitrc +VOLUME /data/ EXPOSE 1024 2812 9001 CMD /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf diff --git a/webkit/client.js b/webkit/client.js index 65373f2..13509b3 100644 --- a/webkit/client.js +++ b/webkit/client.js @@ -189,7 +189,7 @@ function urlopen(req, callback) { case 'png': case 'gif': //TODO: setup a fileserver - data = '/tmp/' + req.requestId; + data = '/data/' + req.requestId; page.render(data, {format: req.requestType}); break; case 'script': diff --git a/webkit/monit/conf.d/webkit.cfg b/webkit/monit/conf.d/webkit.cfg index ebbe181..cd6a4bf 100644 --- a/webkit/monit/conf.d/webkit.cfg +++ b/webkit/monit/conf.d/webkit.cfg @@ -1,40 +1,60 @@ check process webkit-8080 with pidfile /var/run/webkit-8080.pid restart program = "/usr/bin/supervisorctl restart webkit:webkit-8080" - if uptime > 10 minutes then restart + if uptime > 1 hour then restart + if total memory > 100 MB for 5 cycles then restart + if total cpu > 10% for 5 cycles then alert check process webkit-8081 with pidfile /var/run/webkit-8081.pid restart program = "/usr/bin/supervisorctl restart webkit:webkit-8081" - if uptime > 10 minutes then restart + if uptime > 1 hour then restart + if total memory > 100 MB for 5 cycles then restart + if total cpu > 10% for 5 cycles then alert check process webkit-8082 with pidfile /var/run/webkit-8082.pid restart program = "/usr/bin/supervisorctl restart webkit:webkit-8082" - if uptime > 10 minutes then restart + if uptime > 1 hour then restart + if total memory > 100 MB for 5 cycles then restart + if total cpu > 10% for 5 cycles then alert check process webkit-8083 with pidfile /var/run/webkit-8083.pid restart program = "/usr/bin/supervisorctl restart webkit:webkit-8083" - if uptime > 10 minutes then restart + if uptime > 1 hour then restart + if total memory > 100 MB for 5 cycles then restart + if total cpu > 10% for 5 cycles then alert check process webkit-8084 with pidfile /var/run/webkit-8084.pid restart program = "/usr/bin/supervisorctl restart webkit:webkit-8084" - if uptime > 10 minutes then restart + if uptime > 1 hour then restart + if total memory > 100 MB for 5 cycles then restart + if total cpu > 10% for 5 cycles then alert check process webkit-8085 with pidfile /var/run/webkit-8085.pid restart program = "/usr/bin/supervisorctl restart webkit:webkit-8085" - if uptime > 10 minutes then restart + if uptime > 1 hour then restart + if total memory > 100 MB for 5 cycles then restart + if total cpu > 10% for 5 cycles then alert check process webkit-8086 with pidfile /var/run/webkit-8086.pid restart program = "/usr/bin/supervisorctl restart webkit:webkit-8086" - if uptime > 10 minutes then restart + if uptime > 1 hour then restart + if total memory > 100 MB for 5 cycles then restart + if total cpu > 10% for 5 cycles then alert check process webkit-8087 with pidfile /var/run/webkit-8087.pid restart program = "/usr/bin/supervisorctl restart webkit:webkit-8087" - if uptime > 10 minutes then restart + if uptime > 1 hour then restart + if total memory > 100 MB for 5 cycles then restart + if total cpu > 10% for 5 cycles then alert check process webkit-8088 with pidfile /var/run/webkit-8088.pid restart program = "/usr/bin/supervisorctl restart webkit:webkit-8088" - if uptime > 10 minutes then restart + if uptime > 1 hour then restart + if total memory > 100 MB for 5 cycles then restart + if total cpu > 10% for 5 cycles then alert check process webkit-8089 with pidfile /var/run/webkit-8089.pid restart program = "/usr/bin/supervisorctl restart webkit:webkit-8089" - if uptime > 10 minutes then restart + if uptime > 1 hour then restart + if total memory > 100 MB for 5 cycles then restart + if total cpu > 10% for 5 cycles then alert