Outils pour utilisateurs

Outils du site


tech:docker_install_dokuwiki

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
tech:docker_install_dokuwiki [2025/05/31 18:36] Jean-Baptistetech:docker_install_dokuwiki [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Docker DokuWiki}}
 +
 +# Docker - Install DokuWiki
 +
 +
 +Ajout des dépôts "backports"
 +~~~bash
 +echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/backports.list
 +
 +apt-get update
 +~~~
 +
 +Install Docker
 +
 +~~~bash
 +apt-get install docker.io supervisor
 +~~~
 +
 +Git clone de la conf Dockerfile et construction du conteneur
 +
 +`Dockerfile`
 +~~~bash
 +#
 +# INSTALLATION DE DOKUWIKI
 +#
 +
 +FROM alpine:latest
 +
 +#MAINTAINER Jean nospam@me.con
 +LABEL org.opencontainers.image.authors="Jean nospam@me.con"
 +
 +RUN apk update \
 +        && apk upgrade
 +RUN apk add --no-cache \
 +        curl nginx tmux bash vim git openssh-client unzip wget supervisor ca-certificates \
 +        php5-fpm php5-json php5-zlib php5-zip php5-xml php5-pdo php5-phar php5-openssl \
 +        php5-gd php5-iconv php5-mcrypt \
 +        php5-curl php5-opcache php5-ctype php5-apcu \
 +        php5-intl php5-bcmath php5-dom php5-xmlreader \
 +        && rm -rf /var/cache/apk/*
 +
 +# FIXME: privilégier la command COPY à la place de ADD
 +ADD ./etc/php5/fpm/pool.d/dokuwiki.conf /etc/php5/fpm.d/dokuwiki.conf
 +ADD ./etc/nginx/sites-available/default /etc/nginx/conf.d/
 +ADD ./etc/supervisor/supervisord.conf /etc/supervisor/supervisord.conf
 +ADD ./install-dw.sh /root/install-dw.sh
 +ADD ./usr/local/bin/dw-clean.sh /usr/local/bin/
 +
 +RUN mkdir -p /var/www/html/wiki
 +RUN addgroup dokuwiki \ 
 +        && adduser -s /usr/sbin/nologin -h /var/www/html/wiki -S -G dokuwiki dokuwiki
 +
 +#RUN echo "daemon off;" >> /etc/nginx/nginx.conf
 +#RUN sed -i -e 's/# server_tokens off/server_tokens off/' /etc/nginx/nginx.conf
 +RUN mkdir -p /var/log/nginx/wiki
 +RUN bash /root/install-dw.sh
 +RUN chown dokuwiki -R /var/www/wiki
 +
 +
 +EXPOSE 80
 +CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf", "-n" ]
 +~~~
 +
 +~~~bash
 +git clone dw-docker
 +docker build -t jibe/dokuwiki dw-docker
 +~~~
 +
 +~~~bash
 +mkdir /home/wiki
 +~~~
 +
 +`/home/wiki/bin/dw-start.sh`
 +~~~bash
 +#! /bin/bash
 +
 +set -o nounset
 +
 +cd /home/wiki
 +
 +docker stop dokuwiki1 2>/dev/null || true
 +
 +docker rm dokuwiki1 2>/dev/null || true
 +
 +/usr/bin/docker run -a stdout --rm --name=dokuwiki1 -v /home/wiki/data/:/var/www/wiki/www/data -v /home/wiki/conf/:/var/www/wiki/www/conf -m 512m -p 8082:80 jibe/dokuwiki supervisord -c /etc/supervisor/supervisord.conf -n
 +~~~
 +
 +`/etc/supervisor/conf.d/wiki.conf`
 +~~~ini
 +[program:dokuwiki1]
 +command=/home/wiki/bin/dw-start.sh
 +autorestart=false
 +autostart=true
 +stopsignal=INT
 +~~~
 +
 +Ajout des données à l'instance Docker de Dokuwiki (ici données par défaut)
 +~~~bash
 +cd /tmp
 +git clone http://github.com/splitbrain/dokuwiki.git
 +cd dokuwiki                                                              
 +git checkout stable
 +cp -a data/ /home/wiki/
 +cp -a conf/ /home/wiki/
 +~~~
 +
 +FIXME
 +~~~bash
 +chmod -R a=rwX /home/wiki
 +~~~
 +
 +Conf post install
 +
 +**http://monserveur:8082/install.php**
 +
 +Effacement du fichier install.php à l'intérieur du centenaire 
 +
 +~~~bash
 +docker exec -it dokuwiki1 /bin/bash
 +
 +rm /var/www/wiki/dokuwiki/install.php
 +exit
 +
 +docker commit dokuwiki1 jibe/dokuwiki
 +~~~
 +
 +## Notes PRA / Réplication
 +
 +Voir également https://www.dokuwiki.org/plugin:sync
 +
 +~~~bash
 +#! /bin/bash
 +
 +rsync -axP --chown=999:999 --exclude="cache" --exclude="tmp" --exclude="attic" --delete webapp:/home/wiki/data/* /home/wiki/data/
 +rsync -axP --chown=999:999 --exclude="cache" --exclude="tmp" --delete  webapp:/home/wiki/conf/* /home/wiki/conf/
 +
 +rm /home/wiki/data/tmp/* -rf
 +rm /home/wiki/data/cache/* -rf
 +touch -c /home/wiki/conf/local.php
 +~~~
 +
 +## /etc/hosts
 +
 +--add-host="git.acme.fr:10.8.17.115"
 +
 +
 +## Pb
 +
 +### Pb Erreur 500 Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0".
 +
 +~~~
 +Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.1.0".
 +~~~
 +
 +#### Solution
 +
 +Supprimer le plugin en cause dans dokuwiki/lib/plugins/
 +
 +
 +
 +
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki