From bfce274e72f0498a973c1035f0981cb4ec4fccab Mon Sep 17 00:00:00 2001 From: kev Date: Tue, 19 May 2015 18:42:59 +0800 Subject: [PATCH] update dokuwiki --- dokuwiki/Dockerfile | 44 +++++++++++++++++-------------------- dokuwiki/LICENSE | 22 ------------------- dokuwiki/README.md | 8 +++---- dokuwiki/docker-compose.yml | 5 +++++ dokuwiki/dokuwiki.conf | 34 ---------------------------- dokuwiki2/Dockerfile | 19 ---------------- 6 files changed, 29 insertions(+), 103 deletions(-) delete mode 100644 dokuwiki/LICENSE create mode 100644 dokuwiki/docker-compose.yml delete mode 100644 dokuwiki/dokuwiki.conf delete mode 100644 dokuwiki2/Dockerfile diff --git a/dokuwiki/Dockerfile b/dokuwiki/Dockerfile index 4e6a606..ad2ac16 100644 --- a/dokuwiki/Dockerfile +++ b/dokuwiki/Dockerfile @@ -1,29 +1,25 @@ -FROM ubuntu:14.04 -MAINTAINER Ilya Stepanov +# +# Dockerfile for DokuWiki +# +# References +# - https://github.com/docker-library/drupal/blob/master/8/Dockerfile +# - https://www.dokuwiki.org/faq:backup +# -RUN apt-get update && \ - apt-get install -y nginx php5-fpm php5-gd curl && \ - rm -rf /var/lib/apt/lists/* +FROM php:5.6-apache +MAINTAINER kev -RUN mkdir -p /var/www -RUN cd /var/www && curl http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz | tar xz --strip 1 -RUN chown -R www-data:www-data /var/www +WORKDIR /var/www/html -RUN echo "cgi.fix_pathinfo = 0;" >> /etc/php5/fpm/php.ini -RUN echo "daemon off;" >> /etc/nginx/nginx.conf -RUN rm /etc/nginx/sites-enabled/* -ADD dokuwiki.conf /etc/nginx/sites-enabled/ +RUN a2enmod rewrite +RUN curl "http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz" | tar xz --strip 1 +RUN chown -R www-data:www-data . -EXPOSE 80 -VOLUME [ \ - "/var/www/data/pages", \ - "/var/www/data/meta", \ - "/var/www/data/media", \ - "/var/www/data/media_attic", \ - "/var/www/data/media_meta", \ - "/var/www/data/attic", \ - "/var/www/conf", \ - "/var/log" \ -] +VOLUME /var/www/html/data/pages \ + /var/www/html/data/meta \ + /var/www/html/data/media \ + /var/www/html/data/media_attic \ + /var/www/html/data/media_meta \ + /var/www/html/data/attic \ + /var/www/html/conf -CMD /usr/sbin/php5-fpm && /usr/sbin/nginx diff --git a/dokuwiki/LICENSE b/dokuwiki/LICENSE deleted file mode 100644 index d99eceb..0000000 --- a/dokuwiki/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014 Ilya Stepanov - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - diff --git a/dokuwiki/README.md b/dokuwiki/README.md index d5d2b46..c29086d 100644 --- a/dokuwiki/README.md +++ b/dokuwiki/README.md @@ -1,7 +1,7 @@ docker-dokuwiki =============== -Docker container image with [DokuWiki](https://www.dokuwiki.org/dokuwiki) and nginx +Docker container image with [DokuWiki](https://www.dokuwiki.org/dokuwiki) and apache+php. ###How to run @@ -9,7 +9,7 @@ Assume your docker host is localhost and HTTP public port is 8000 (change these First, run new dokuwiki container: - docker run -d -p 8000:80 --name dokuwiki istepanov/dokuwiki + docker run -d -p 8000:80 --name dokuwiki vimagick/dokuwiki Then setup dokuwiki using installer at URL `http://localhost:8000/install.php` @@ -24,7 +24,7 @@ To make sure data won't be deleted if container is removed, create an empty cont docker stop dokuwiki && docker rm dokuwiki # to restore dokuwiki, create new dokuwiki container and attach dokuwiki-data volume to it - docker run -d -p 8000:80 --volumes-from dokuwiki-data --name dokuwiki istepanov/dokuwiki + docker run -d -p 8000:80 --volumes-from dokuwiki-data --name dokuwiki vimagick/dokuwiki ###How to backup data @@ -34,7 +34,7 @@ To make sure data won't be deleted if container is removed, create an empty cont ###How to restore from backup #create new dokuwiki container, but don't start it yet - docker create -p 8000:80 --name dokuwiki istepanov/dokuwiki + docker create -p 8000:80 --name dokuwiki vimagick/dokuwiki # create data container for persistency (optional) docker run --volumes-from dokuwiki --name dokuwiki-data busybox diff --git a/dokuwiki/docker-compose.yml b/dokuwiki/docker-compose.yml new file mode 100644 index 0000000..86f072e --- /dev/null +++ b/dokuwiki/docker-compose.yml @@ -0,0 +1,5 @@ +dokuwiki: + image: vimagick/dokuwiki:latest + ports: + - "8000:80" + restart: always diff --git a/dokuwiki/dokuwiki.conf b/dokuwiki/dokuwiki.conf deleted file mode 100644 index 4e8b0f3..0000000 --- a/dokuwiki/dokuwiki.conf +++ /dev/null @@ -1,34 +0,0 @@ -server { - listen 80; - - root /var/www; - index index.php index.html index.htm; - - location / { - index doku.php; - try_files $uri $uri/ @dokuwiki; - } - - location @dokuwiki { - rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; - rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; - rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last; - rewrite ^/(.*) /doku.php?id=$1 last; - } - - location ~ \.php$ { - try_files $uri =404; - fastcgi_pass unix:/var/run/php5-fpm.sock; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - } - - location ~ /\.ht { - deny all; - } - - location ~ /(data|conf|bin|inc)/ { - deny all; - } -} \ No newline at end of file diff --git a/dokuwiki2/Dockerfile b/dokuwiki2/Dockerfile deleted file mode 100644 index b3c26a8..0000000 --- a/dokuwiki2/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# -# Dockerfile for Dokuwiki -# - -FROM php:5.6-apache -MAINTAINER kev - -WORKDIR /var/www/html - -RUN a2enmod rewrite -RUN curl "http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz" | tar xz --strip 1 -RUN chown -R www-data:www-data . - -VOLUME [ \ - "/var/www/html/conf", \ - "/var/www/html/data", \ - "/var/www/html/lib/plugins" \ -] -