summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClark Laughlin <clark.laughlin@linaro.org>2015-05-29 18:38:35 -0400
committerClark Laughlin <clark.laughlin@linaro.org>2015-05-29 18:38:35 -0400
commitcd4de73e673b6679885311c9d3ba115413f76de4 (patch)
tree447324993f725df2940465dfcc5ab9301e0d1472
parentd53660d4233e476dcc142c4168b7143af61930b1 (diff)
add lighttpd container for serving static logs
-rwxr-xr-xdocker-start-containers8
-rw-r--r--lighttpd-static/Dockerfile15
-rwxr-xr-xlighttpd-static/docker-build-image4
-rw-r--r--lighttpd-static/lighttpd.conf31
4 files changed, 58 insertions, 0 deletions
diff --git a/docker-start-containers b/docker-start-containers
index 12906ad..ecfbc84 100755
--- a/docker-start-containers
+++ b/docker-start-containers
@@ -9,6 +9,14 @@ docker run -d --name neo4j \
-v /srv/ci-reporting/data:/var/lib/neo4j/data \
clarktlaugh/neo4j-docker-community
+# start the static log web server container
+docker run -d --name static-log-server \
+ --privileged \
+ -p 81:8080 \
+ --restart=always \
+ -v /srv/ci-reporting/logs:/var/www \
+ lighttpd-static
+
# start the web-app container, linked to the neo4j container
docker run -d --name tempest-ci-webapp \
--link neo4j:neo4j \
diff --git a/lighttpd-static/Dockerfile b/lighttpd-static/Dockerfile
new file mode 100644
index 0000000..3a1c084
--- /dev/null
+++ b/lighttpd-static/Dockerfile
@@ -0,0 +1,15 @@
+FROM gliderlabs/alpine:3.1
+MAINTAINER Clark Laughlin <clark.laughlin@linaro.org>
+
+RUN apk add --update \
+ lighttpd \
+ && rm -rf /var/cache/apk/*
+
+ADD lighttpd.conf /etc/lighttpd/lighttpd.conf
+RUN adduser www-data -G www-data -H -s /bin/false -D
+
+EXPOSE 8080
+VOLUME /var/www
+
+ENTRYPOINT ["lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"]
+
diff --git a/lighttpd-static/docker-build-image b/lighttpd-static/docker-build-image
new file mode 100755
index 0000000..32b9fd4
--- /dev/null
+++ b/lighttpd-static/docker-build-image
@@ -0,0 +1,4 @@
+#!/bin/bash
+docker rmi lighttpd-static
+docker build -t lighttpd-static .
+
diff --git a/lighttpd-static/lighttpd.conf b/lighttpd-static/lighttpd.conf
new file mode 100644
index 0000000..e4af16f
--- /dev/null
+++ b/lighttpd-static/lighttpd.conf
@@ -0,0 +1,31 @@
+# See /usr/share/doc/lighttpd
+
+server.port = 8080
+server.username = "www-data"
+server.groupname = "www-data"
+server.document-root = "/var/www"
+server.errorlog = "/dev/stdout"
+server.modules += ( "mod_setenv" )
+dir-listing.activate = "enable"
+index-file.names = ( "index.html" )
+mimetype.assign = (
+ ".html" => "text/html",
+ ".txt" => "text/plain",
+ ".log" => "text/plain",
+ ".json" => "text/plain",
+ ".css" => "text/css",
+ ".js" => "application/x-javascript",
+ ".jpg" => "image/jpeg",
+ ".jpeg" => "image/jpeg",
+ ".gif" => "image/gif",
+ ".png" => "image/png",
+ ".gz" => "text/plain",
+ "" => "application/octet-stream"
+ )
+
+$HTTP["url"] =~ "\.gz$" {
+ setenv.add-response-header = ( "Content-Encoding" => "x-gzip" )
+ compress.filetype = ()
+ mimetype.assign = ("" => "text/plain")
+}
+