commit f538a318f4a0656ea42992c6ee54b759eea8a2ea Author: Miroslav Prasil Date: Sat Sep 13 20:55:07 2014 +0000 Initial import diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8addac7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,46 @@ +# VERSION 0.1 +# AUTHOR: Miroslav Prasil +# DESCRIPTION: Image with DokuWiki & lighttpd +# TO_BUILD: docker build -t mprasil/dokuwiki . +# TO_RUN: docker run -d -p 80:80 --name my_wiki mprasil/dokuwiki + + +FROM ubuntu:14.04 +MAINTAINER Miroslav Prasil + +# Set the version you want of Twiki +ENV DOKUWIKI_VERSION 2014-05-05a +ENV DOKUWIKI_CSUM fb44f206d1550921c640757599e90bb9 + +ENV LAST_REFRESHED 13. September 2014 +# Update & install packages +RUN apt-get update && apt-get -y upgrade +RUN apt-get -y install wget \ + lighttpd \ + php5-cgi \ + php5-gd + +# Download & deploy twiki +RUN wget -O /dokuwiki.tgz \ + "http://download.dokuwiki.org/src/dokuwiki/dokuwiki-$DOKUWIKI_VERSION.tgz" +RUN if [ "$DOKUWIKI_CSUM" != "$(md5sum /dokuwiki.tgz | awk '{print($1)}')" ];\ + then echo "Wrong md5sum of downloaded file!"; exit 1; fi; +RUN tar -zxf dokuwiki.tgz +RUN mv "/dokuwiki-$DOKUWIKI_VERSION" /dokuwiki + +# Set up ownership +RUN chown -R www-data:www-data /dokuwiki + +# Cleanup +RUN rm dokuwiki.tgz + +# Configure lighttpd +ADD dokuwiki.conf /etc/lighttpd/conf-available/20-dokuwiki.conf +RUN lighty-enable-mod dokuwiki fastcgi accesslog +RUN mkdir /var/run/lighttpd && chown www-data.www-data /var/run/lighttpd + +EXPOSE 80 +VOLUME ["/dokuwiki/data/", "/var/log/"] + +ENTRYPOINT ["/usr/sbin/lighttpd", "-D", "-f", "/etc/lighttpd/lighttpd.conf"] + diff --git a/dokuwiki.conf b/dokuwiki.conf new file mode 100644 index 0000000..b22f2b8 --- /dev/null +++ b/dokuwiki.conf @@ -0,0 +1,38 @@ +# DokuWiki configuration + +server.modules += ("mod_rewrite") + +fastcgi.server = ( ".php" => + ( "localhost" => + ( + "socket" => "/var/run/lighttpd/php-fastcgi.socket", + "bin-path" => "/usr/bin/php5-cgi" + ) + ) +) + +$HTTP["host"] =~ "." { + server.document-root = "/dokuwiki" + static-file.exclude-extensions = ( ".php" ) + + # deny access completely to these + $HTTP["url"] =~ "/(\.|_)ht" { url.access-deny = ( "" ) } + $HTTP["url"] =~ "^/(bin|data|inc|conf)/" { url.access-deny = ( "" ) } + + # rewrites for dokuwiki + $HTTP["url"] =~ "^" { index-file.names = ("doku.php") } + url.rewrite = ( + "^/lib/.*$" => "$0", + "^/_media/(.*)?\?(.*)$" => "/lib/exe/fetch.php?media=$1&$2", + "^/_media/(.*)$" => "/lib/exe/fetch.php?media=$1", + "^/_detail/(.*)?\?(.*)$" => "/lib/exe/detail.php?media=$1&$2", + "^/_detail/(.*)?$" => "/lib/exe/detail.php?media=$1", + "^/_export/([^/]+)/(.*)\?(.*)$" => "/doku.php?do=export_$1&id=$2&$3", + "^/_export/([^/]+)/(.*)" => "/doku.php?do=export_$1&id=$2", + "^/doku.php.*" => "$0", + "^/feed.php.*" => "$0", + "^/install.php.*" => "$0", + "^/(.*)\?(.*)" => "/doku.php?id=$1&$2", + "^/(.*)" => "/doku.php?id=$1" + ) +}