1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-12-25 02:04:06 +02:00

update webkit

This commit is contained in:
kev 2014-12-25 18:35:53 +08:00
parent 711f1f4bbf
commit 3ff2216625
5 changed files with 21 additions and 25 deletions

View File

@ -6,14 +6,14 @@ FROM ubuntu:14.04
MAINTAINER kev
RUN apt-get update && apt-get install -y supervisor haproxy libfontconfig1 libfreetype6
RUN mkdir -p /usr/local/lib/webkit/ /etc/supervisor/conf.d/ /etc/monit/
RUN mkdir -p /usr/local/lib/webkit/ /etc/supervisor/conf.d/ /etc/monit/ /var/lib/monit/events/
ADD ./*.js ./includes /usr/local/lib/webkit/
ADD ./bin/* /usr/local/bin/
ADD ./haproxy.cfg /etc/haproxy/
ADD ./supervisor/supervisord.conf /etc/supervisor/
ADD ./supervisor/conf.d/* /etc/supervisor/conf.d/
ADD ./monit/* /etc/monit/
ADD ./monit/ /etc/monit/
EXPOSE 1024 2812 9001

View File

@ -1,10 +1,14 @@
A simple service for rendering javascript-enabled website.
A simple web-service for rendering javascript-enabled website.
## server
phantomjs --config=config.json server.js
docker run -d --restart=always -p 1024:1024 -p 2812:2812 -p 9001:9001 --name=webkit vimagick/webkit
## client
http :1024 targetUrl=https://github.com/ requestType=png loadImages:=true execScripts:='{"preInjected": ["1+2+3"], "postInjected": ["Math.sqrt(2)"]}'
http :1024 targetUrl=https://github.com/
## admin
firefox localhost:2812
firefox localhost:9001

View File

@ -1,9 +0,0 @@
#!/bin/bash
#
# run webkit instance
#
set -e
cd /usr/local/lib/webkit
exec phantomjs server.js "$@"

View File

@ -1,40 +1,40 @@
check process webkit-8080 with pidfile /var/run/webkit-8080.pid
restart program = "/usr/bin/supervisorctl restart webkit:webkit-8080"
if uptime > 10 minute then restart
if uptime > 10 minutes then restart
check process webkit-8081 with pidfile /var/run/webkit-8081.pid
restart program = "/usr/bin/supervisorctl restart webkit:webkit-8081"
if uptime > 10 minute then restart
if uptime > 10 minutes then restart
check process webkit-8082 with pidfile /var/run/webkit-8082.pid
restart program = "/usr/bin/supervisorctl restart webkit:webkit-8082"
if uptime > 10 minute then restart
if uptime > 10 minutes then restart
check process webkit-8083 with pidfile /var/run/webkit-8083.pid
restart program = "/usr/bin/supervisorctl restart webkit:webkit-8083"
if uptime > 10 minute then restart
if uptime > 10 minutes then restart
check process webkit-8084 with pidfile /var/run/webkit-8084.pid
restart program = "/usr/bin/supervisorctl restart webkit:webkit-8084"
if uptime > 10 minute then restart
if uptime > 10 minutes then restart
check process webkit-8085 with pidfile /var/run/webkit-8085.pid
restart program = "/usr/bin/supervisorctl restart webkit:webkit-8085"
if uptime > 10 minute then restart
if uptime > 10 minutes then restart
check process webkit-8086 with pidfile /var/run/webkit-8086.pid
restart program = "/usr/bin/supervisorctl restart webkit:webkit-8086"
if uptime > 10 minute then restart
if uptime > 10 minutes then restart
check process webkit-8087 with pidfile /var/run/webkit-8087.pid
restart program = "/usr/bin/supervisorctl restart webkit:webkit-8087"
if uptime > 10 minute then restart
if uptime > 10 minutes then restart
check process webkit-8088 with pidfile /var/run/webkit-8088.pid
restart program = "/usr/bin/supervisorctl restart webkit:webkit-8088"
if uptime > 10 minute then restart
if uptime > 10 minutes then restart
check process webkit-8089 with pidfile /var/run/webkit-8089.pid
restart program = "/usr/bin/supervisorctl restart webkit:webkit-8089"
if uptime > 10 minute then restart
if uptime > 10 minutes then restart

View File

@ -1,5 +1,6 @@
[program:webkit]
command = /usr/local/bin/webkit.sh %(process_num)d
command = /usr/local/bin/phantomjs server.js %(process_num)d
numprocs_start = 8080
numprocs = 10
process_name = %(program_name)s-%(process_num)d
directory = /usr/local/lib/webkit