Public | Automated Build

Last pushed: 8 months ago
Short Description
Docker image with dokuwiki and nginx. Supports user-friendly URLs.
Full Description

istepanov/dokuwiki






Docker container image with DokuWiki and nginx

How to run

Assume your docker host is localhost and HTTP public port is 8000 (change these values if you need).

First, run new dokuwiki container:

docker run -d -p 8000:80 --name dokuwiki istepanov/dokuwiki:2.0

Then setup dokuwiki using installer at URL http://localhost:8000/install.php

How to make data persistent

To make sure data won't be deleted if container is removed, create an empty container named dokuwiki-data and attach DokuWiki container's volumes to it. Volumes won't be deleted if at least one container owns them.

# create data container
docker run --volumes-from dokuwiki --name dokuwiki-data busybox

# now you can safely delete dokuwiki container
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:2.0

Persistent plugins

Dokuwiki installs plugins to lib/plugins/, but this folder isn't inside persistent volume storage by default, so all plugins will be erased when container is re-created. The recommended way to make plugins persistent is to create your own Docker image with istepanov/dokuwiki as a base image and use shell commands inside the Dockerfile to install needed plugins.

Example (install Dokuwiki ToDo plugin):

FROM istepanov/dokuwiki
MAINTAINER Ilya Stepanov <dev@ilyastepanov.com>

# this is an example Dockerfile that demonstrates how to add Dokuwiki plugins to istepanov/dokuwiki image

RUN apt-get update && \
    apt-get install -y unzip && \
    apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# add todo plugin
RUN curl -O -L "https://github.com/leibler/dokuwiki-plugin-todo/archive/stable.zip" && \
    unzip stable.zip -d /var/www/lib/plugins/ && \
    mv /var/www/lib/plugins/dokuwiki-plugin-todo-stable /var/www/lib/plugins/todo && \
    rm -rf stable.zip

How to backup data

# create dokuwiki-backup.tar.gz archive in current directory using temporaty container
docker run --rm --volumes-from dokuwiki -v $(pwd):/backup ubuntu tar zcvf /backup/dokuwiki-backup.tar.gz /var/dokuwiki-storage

Note: only these folders are backed up:

  • data/pages/
  • data/meta/
  • data/media/
  • data/media_attic/
  • data/media_meta/
  • data/attic/
  • conf/

How to restore from backup

#create new dokuwiki container, but don't start it yet
docker create -p 8000:80 --name dokuwiki istepanov/dokuwiki:2.0

# create data container for persistency (optional)
docker run --volumes-from dokuwiki --name dokuwiki-data busybox

# restore from backup using temporary container
docker run --rm --volumes-from dokuwiki -w / -v $(pwd):/backup ubuntu tar xzvf /backup/dokuwiki-backup.tar.gz

# start dokuwiki
docker start dokuwiki
Docker Pull Command
Owner
istepanov
Source Repository

Comments (7)
telcosys
a month ago

With image istepanov/dokuwiki (ID:a431054fb752 2017-01-20) fail download of /lib/exe/css.php and
/lib/exe/js.php (transfer interrupted)

Solved running:
sudo docker exec csndoc chmod +rx /var/lib/nginx /var/lib/nginx/tmp /var/lib/nginx/tmp/fastcgi

migae21
6 months ago

"can't download extensions since it lacks https support?"

add php7-openssl to the dockerfile after the line apk --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ add \

Here is my Version: https://hub.docker.com/r/migae21/dokuwiki/

idef1x
6 months ago

can't download extensions since it lacks https support?

adampski
a year ago

"How to make data persistent" is also wrong, the commands you give do not offer persistence

shins5kai
2 years ago

How can I attach to the containers and qui the bash you start ?
because I stay sticky in with a black screen and I can't do anything ...

liphvf
2 years ago

It's a good dokuwiki. One suggestion. Add in the volume folder: "lib/plugins/" (for plugins backup.)