A good old fashioned self backup-ing dokuwiki in a box.
A self installing instance of the venerable dokuwiki that backs itself up to a git repo every hour. All wrapped up in a docker image (sorry, bow not included).
I wanted a dead simple method of setting up wikis without hassle. Using a git repo for backups simplifies deployment and eliminates the need for a host with persistent storage.
-
Install Docker if you haven't already.
-
Create an empty git repo (i.e. BitBucket, GitHub, your own server). In step 3, let’s pretend you created a repo named "wiki" on BitBucket.
-
$ docker run -d --restart=always --name=wiki -e SSH_PORT=22 -e SSH_DOMAIN=bitbucket.org -e [email protected]:YOUR_BITBUCKET_USERNAME/wiki.git -p 3000:3000 ericbarch/dockuwiki
-
On the first run, the container will generate a unique SSH key.
docker logs wiki
to get the public key. Add this public key to the SSH Keys section of BitBucket, GitHub, your own server, etc. -
Wait a few moments, then access your freshly minted wiki at http://YOUR_DOCKER_HOST_IP:3000. The initial configuration page can be accessed at http://YOUR_DOCKER_HOST_IP:3000/install.php.
Sure, I'm not going to tell you how to live your life:
-
Install Docker (it's officially supported for ARM!)
-
Give the pi user access to the Docker daemon:
sudo usermod -a -G docker pi
. Reboot time! -
Follow the same steps from the "How do I use it?" section above, but replace "ericbarch/dockuwiki" with "ericbarch/dockuwiki:rpi".
Lucky for you, I wrote a blog post about that!
Just run the same docker command again and add the new SSH key it generates. If dockuwiki finds an existing wiki, it clones and hosts it.
Nope. TLS only, baby. But that’s where Let’s Encrypt saves the day:
-
Start the nginx container:
$ docker run -d --restart=always --name=nginxproxy \ -p 80:80 -p 443:443 \ --name nginx-proxy \ -v /etc/nginx/certs \ -v /etc/nginx/vhost.d \ -v /usr/share/nginx/html \ -v /var/run/docker.sock:/tmp/docker.sock:ro \ jwilder/nginx-proxy
-
Start the Let’s Encrypt container:
$ docker run -d --restart=always --name=letsencrypt \ --volumes-from nginx-proxy \ -v /var/run/docker.sock:/var/run/docker.sock:ro \ jrcs/letsencrypt-nginx-proxy-companion
-
Start the Dockuwiki container with your domain name and email:
$ docker run -d --restart=always --name=wiki \ -e SSH_PORT=22 -e SSH_DOMAIN=bitbucket.org -e [email protected]:YOUR_BITBUCKET_USERNAME/wiki.git \ -e VIRTUAL_HOST=foo.bar.com -e LETSENCRYPT_HOST=foo.bar.com \ -e [email protected] ericbarch/dockuwiki
-
Make sure to add the SSH key that was generated by the dockuwiki container to your git host. Note that the Let's Encrypt container will take its sweet time generating keys and certs before HTTPS comes up.
I tried to be cute by combining "Docker" and "Doku". Get it? Hah!
I live and die by indexmenu, upgrade, and bootstrap3. You can install all of these from the built in extension manager in your dockuwiki instance.
Sure! Just run docker exec -u wiki wiki /home/wiki/backup_once.sh
to trigger a backup.
No problemo, moon bound traveler. Either take the machine with you that hosts dockuwiki, or use something like a Raspberry Pi to deploy a new instance with the same repo URL. I don’t suggest running multiple instances simultaneously, but your stand in wiki host will collect all your changes and continue attempting to reach the internet until it is safely back on Earth.
A dude named Eric Barch that is hoping the community will embrace the project so he can collect mad internet karma and retire early.