Git Product home page Git Product logo

docker-dokuwiki's Introduction

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 <[email protected]>

# 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-dokuwiki's People

Contributors

istepanov avatar cmuller avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.