jpedryc / dokuwiki-docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DokuWiki Docker

DokuWiki 🤝 Docker

A dockerized setup for DokuWiki development

This setup was created to make development around DokuWiki easier and more maintainable. Just fork the original repo splitbrain/dokuwiki and start playing around 🚀

🧱 PHP 7.4 FPM | Composer (latest) | Xdebug (latest) | Nginx 1.8 Alpine

Prerequisites

  1. Make sure you have docker & docker-compose set-up.
  2. Add 127.0.0.1 dokuwiki.local in your /etc/hosts.
    ℹ This is optional - you can customize the hostname in server/dokuwiki.conf
  3. Create an .env file and set up environmental variables accordingly.
    cp .env.example .env

First run

Go to /install.php and perform the standard DokuWiki install process.


Xdebug in PHP Storm

Xdebug Port Settings

Xdebug Port Settings

Server Path Mappings

Server Path Mappings


Testing

Unit Testing

ℹ Before running any tests, you should fetch PHPUnit (DokuWiki - Unit Testing). You can do it by:
docker-compose exec app bash -c 'cd _test; php fetchphpunit.php'

  • To run all tests:
    docker-compose exec app bash -c 'cd _test; php phpunit.phar'

  • To run just a single file test:
    docker-compose exec app bash -c 'cd _test; php phpunit.phar tests/inc/input.test.php'

Accordingly, to the original documentation, you should be able to cover all other cases.

BrowserStack

🚧 🚧 🚧


Coding Style

PHP_CodeSniffer

ℹ Before running any code style checks, you should fetch PHP_CodeSniffer. You can do it by:

  1. docker-compose exec app bash -c 'cd _test; wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar'
  2. docker-compose exec app bash -c 'cd _test; wget https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar'

⚠ These two files will be recognised by git as new files by default in the original (forked) repo. You can locally ignore them by adding their paths to .git/info/exclude.

  • To check a single file:
    docker-compose exec app bash -c 'cd _test; php phpcs.phar ../feed.php'

  • To try fixing it:
    docker-compose exec app bash -c 'cd _test; php phpcbf.phar ../feed.php'


Makefile

Additional commands were added for easier DokiWiki handling:

  • Reinstall DokuWiki (without loosing data)
    make reinstall

About


Languages

Language:Shell 81.8%Language:Dockerfile 17.0%Language:Makefile 1.2%