Giter Club home page Giter Club logo

docker's Introduction

DokuWiki Docker Image

This image is based on the official PHP Apache image and provides a DokuWiki installation. It is meant to be used with a reverse proxy that handles SSL termination and authentication. It's probably not worth it to use this image for a standalone installation (read Running DokuWiki on Docker for alternatives).

Quick Start:

docker run -p 8080:8080 --user 1000:1000 -v /path/to/storage:/storage dokuwiki/dokuwiki:stable
  • Exposed Port: 8080
  • Volume: /storage
  • Can be run as non-root user. Be sure the storage volume is writable by the given uid.
  • Available tags: stable, oldstable, master and versions like 2020-07-29a. latest is an alias for stable.

An example docker-compose file is included in the repository.

On first run, use DokuWiki's installer to configure the wiki as usual.

Features

  • xsendfile configured and enabled
  • imagemagick installed and enabled
  • nice URLs via rewriting configured and enabled
  • farming support via the farmer plugin
  • docker health check running basic DokuWiki checks (every 30 seconds, 3 retries)

Note: This image does not include a mail server. You need to configure DokuWiki to use an external mail server, this is most easily achieved using the SMTP plugin.

PHP Configuration & Environment

The container runs the standard production php.ini. Some options can be set via environment variables:

  • PHP_UPLOADLIMIT - File upload size limit. Default 128M
  • PHP_MEMORYLIMIT - Process Memory Limit. Default 256M
  • PHP_TIMEZONE - The timezone. Default UTC

Custom PHP configuration values can be set in a php.ini file in the storage volume.

Farming

This image supports farming via the farmer plugin. To use it, install the plugin and configure it as described in the plugin documentation. The initial farm configuration is already done in this image. The farm directory is /storage/farm.

Use a reverse proxy to route animal requests to this container.

How this image handles user data

Besides the obvious page and media data, extensions and configuration need to be persisted over container replacements. However, it needs to be differentiated between user installed extensions and configuration and bundled extensions and configuration.

This image uses a single storage volume for all user data.

Bundled Plugins and Templates are moved to separate directories in the container and symlinked to the storage volume. The storage volume is then symlinked to the proper tpl and plugins location. This means that the storage volume will never contain stale bundled extensions.

Similarly, the core configuration is moved to a separate directory but the preload mechanism is used to load them as default. The storage volume will only contain local configuration this way.

Required symlinks are rechecked on every container restart.

This setup ensures that all adjustments you may make via the Admin interface will be stored correctly in the storage volume while all bundled data is kept in the container and is correctly updated/replaced when the container is updated.

Development

To manually build the image:

docker build -t dokuwiki/dokuwiki:stable .

Builds and deployments are currently done daily using the GitHub Actions workflow.

docker's People

Contributors

klap-in avatar splitbrain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

kossmac fama

docker's Issues

Dokuwiki migration question

Hello Team,

Good day!

I am planning to migrate our existing dokuwiki from Binary installation into container. I wonder if this supports authentication like OpenLDAP? If yes, is there somewhere in the configuration file(s) that I can enable it? Also, do you have a tool that I can use to migrate my existing dokuwiki pages to the dokuwiki container?

Thank you in advance!

./ed

Can't stop container in rootless mode

Hey!

I'm using DokuWiki in rootless mode, which works great now, without any file reading/writing problems, but I've encountered that I cannot stop the container without having to use docker kill or restarting the Docker daemon.

If I run docker stop dokuwiki I get the error: Error response from daemon: cannot stop container: dokuwiki: permission denied. Sadly, this means that I can't update the container without having to forcefully kill it nor use Watchtower with it.

The container has the usual processes of any container and the users: root and www-data that other containers I run also have without causing any problems.

I don't seem to be able to get any logs showing errors and the permissions don't look too weird, so I'm not sure where to look, but I suspect the owner of some process may be at fault.

I'd be glad if you could help me with this, in case it's fixable. Thanks for reading and for this good project! (it's the only wiki I can run with almost zero issues) :)

Provide master image?

Would it make sense to also build an image based on the current master? We would need to find a way to trigger the build from the main repo. We would probably also not want to rebuild the stable and oldstable releases every time the master changes.

Ability to modify the default dokuwiki theme for other plugins

First of all, big thanks for an official docker image, I always like when developers make their official images themselves.

I wanted to setup the Translation plugin, but that requires modifying the sidebarheader.html file in the default dokuwiki theme to show a dropdown with available translations on the sidebar.

However, that one is symlinked to a directory within the container at startup:

image

I thought of potentially removing the symlink and placing the default theme, but will that not break the container?

Make compatible with Farming

Theoretically the container should work fine with farming since all incoming traffic arrives at the same vhost. However the Farmer plugin requires to set up its own config_cascade wich currently conflicts with the one needed by the docker container.

It's probably easiest to adjust the farmer plugin to recognize the docker environment and integrate itself nicely into the cascade. The docker image needs to detect the farmer plugin and load the farmcore since the farmer plugin can not write to inc/preload.php

Helm Chart

Could you let me know if you are planning to add Helm Chart for DokuWiki at any time in the future?

Permission problems in rootless Docker

Hey!

I've been trying to setup DokuWiki correctly using rootless Docker, but I've found some problems:

  1. Using user: "1000:1000" gives me a "Permission denied" error while trying to create subfolders in the storage folder (even though it can create storage correctly).
  2. Not using user: "1000:1000" can create all the folders correctly, but for some reason it can't find them, saying: "The datadir ('pages') at /storage/data/pages is not found, isn't accessible or writable", even if I already ran the install.php file.

I don't know if it's relevant, but the install.php and other files in /var/www/html have owner 1001 and group 127. Thanks in advance, and sorry if this isn't something that can be fixed.

Cannot run install.php on fresh container

When I start a fresh stable dokuwiki container and point my reverse proxy to it, navigating to wiki.example.com/install.php results in a 500 error with the logs for the dokuwiki container saying the following

[Sun May 19 13:24:14.432309 2024] [php:error] [pid 97] [client REACTEDIP:54462] PHP Fatal error:  Uncaught TypeError: array_unshift(): Argument #1 ($array) must be of type array, null given in /var/www/html/inc/preload.php:16\nStack trace:\n#0 /var/www/html/inc/preload.php(16): array_unshift()\n#1 /var/www/html/inc/init.php(31): include('...')\n#2 /var/www/html/install.php(20): require_once('...')\n#3 {main}\n  thrown in /var/www/html/inc/preload.php on line 16
[REDACTEDIP]:80 [REDACTEDIP] - - [19/May/2024:13:24:14 +0000] "GET /install.php HTTP/1.1" 500 195 "-" "[REDACTED USERAGENT]"

I think what's happening is that the install.php script already has DOKU_CONF defined by the time it gets to preload.php, but config_cascade is empty (or at the very least it's not filled with what config_cascade.php wants to fill it with).. but because DOKU_CONF is already defined, it skips running config_cascade.php

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.