1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-28 09:08:50 +02:00
This commit is contained in:
kev 2015-08-25 00:52:58 +08:00
parent 2dbe402e26
commit f8eee54f5d

View File

@ -1,46 +1,26 @@
docker-dokuwiki
===============
dokuwiki
========
Docker container image with [DokuWiki](https://www.dokuwiki.org/dokuwiki) and apache+php.
![](https://badge.imagelayers.io/vimagick/dokuwiki:latest.svg)
###How to run
[DokuWiki][1] is a simple to use and highly versatile Open Source wiki software that doesn't require a database.
Assume your docker host is localhost and HTTP public port is 8000 (change these values if you need).
## Run
First, run new dokuwiki container:
```
$ docker run -d -p 8000:80 --restart always --name dokuwiki vimagick/dokuwiki
```
docker run -d -p 8000:80 --name dokuwiki vimagick/dokuwiki
## Backup
Then setup dokuwiki using installer at URL `http://localhost:8000/install.php`
```
$ docker run --volumes-from dokuwiki -v `pwd`:/backup alpine tar czf /backup/dw-backup.tgz /var/www/html
```
###How to make data persistent
## Restore
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.
```
$ docker run --volumes-from dokuwiki -v `pwd`:/backup alpine tar xzf /backup/dw-backup.tgz
```
# 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 vimagick/dokuwiki
###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/www
###How to restore from backup
#create new dokuwiki container, but don't start it yet
docker create -p 8000:80 --name dokuwiki vimagick/dokuwiki
# 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
[1]: https://www.dokuwiki.org/dokuwiki