Add some complications to MediaWiki image
This commit is contained in:
parent
990ca64225
commit
7184e94feb
4 changed files with 82 additions and 32 deletions
|
@ -5,36 +5,39 @@ WORKDIR /usr/src
|
||||||
RUN apk update && apk add git
|
RUN apk update && apk add git
|
||||||
|
|
||||||
ADD https://releases.wikimedia.org/mediawiki/1.42/mediawiki-1.42.3.tar.gz .
|
ADD https://releases.wikimedia.org/mediawiki/1.42/mediawiki-1.42.3.tar.gz .
|
||||||
RUN tar -xzf mediawiki-1.42.3.tar.gz
|
RUN tar -xzf mediawiki-1.42.3.tar.gz && mv mediawiki-1.42.3 mediawiki
|
||||||
|
|
||||||
RUN git clone -b REL1_42 https://gerrit.wikimedia.org/r/mediawiki/extensions/MobileFrontend; \
|
WORKDIR /usr/src/mediawiki
|
||||||
rm -rf MobileFrontend/.git
|
|
||||||
|
|
||||||
RUN git clone -b REL1_42 https://gerrit.wikimedia.org/r/mediawiki/extensions/PluggableAuth; \
|
RUN git clone -b REL1_42 https://gerrit.wikimedia.org/r/mediawiki/extensions/MobileFrontend extensions/MobileFrontend; \
|
||||||
rm -rf PluggableAuth/.git
|
rm -rf extensions/MobileFrontend/.git
|
||||||
|
|
||||||
RUN git clone -b REL1_42 https://gerrit.wikimedia.org/r/mediawiki/extensions/OpenIDConnect; \
|
RUN git clone -b REL1_42 https://gerrit.wikimedia.org/r/mediawiki/extensions/PluggableAuth extensions/PluggableAuth; \
|
||||||
rm -rf OpenIDConnect/.git
|
rm -rf extensions/PluggableAuth/.git
|
||||||
|
|
||||||
RUN git clone -b REL1_42 https://gerrit.wikimedia.org/r/mediawiki/extensions/Widgets; \
|
RUN git clone -b REL1_42 https://gerrit.wikimedia.org/r/mediawiki/extensions/OpenIDConnect extensions/OpenIDConnect; \
|
||||||
rm -rf Widgets/.git
|
rm -rf extensions/OpenIDConnect/.git
|
||||||
|
|
||||||
|
RUN git clone -b REL1_42 https://gerrit.wikimedia.org/r/mediawiki/extensions/Widgets extensions/Widgets; \
|
||||||
|
rm -rf extensions/Widgets/.git
|
||||||
|
|
||||||
FROM docker.io/library/unit:php8.2
|
FROM docker.io/library/unit:php8.2
|
||||||
|
|
||||||
WORKDIR /var/www/html
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
libicu-dev librsvg2-bin \
|
libicu-dev librsvg2-bin imagemagick git unzip \
|
||||||
&& docker-php-ext-configure intl \
|
|
||||||
&& docker-php-ext-install -j$(nproc) intl \
|
|
||||||
&& docker-php-ext-install -j$(nproc) mysqli \
|
|
||||||
&& apt-get install -y imagemagick \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY --from=builder --chown=unit:unit /usr/src/mediawiki-1.42.3 w/
|
RUN docker-php-ext-configure intl \
|
||||||
COPY --from=builder --chown=unit:unit /usr/src/MobileFrontend w/extensions/MobileFrontend
|
&& docker-php-ext-install -j$(nproc) intl \
|
||||||
COPY --from=builder --chown=unit:unit /usr/src/PluggableAuth w/extensions/PluggableAuth
|
&& docker-php-ext-install -j$(nproc) mysqli \
|
||||||
COPY --from=builder --chown=unit:unit /usr/src/OpenIDConnect w/extensions/OpenIDConnect
|
&& docker-php-ext-install -j$(nproc) calendar
|
||||||
COPY --from=builder --chown=unit:unit /usr/src/Widgets w/extensions/Widgets
|
|
||||||
|
COPY --from=builder --chown=unit:unit /usr/src/mediawiki w/
|
||||||
|
COPY --from=docker.io/composer/composer /usr/bin/composer /usr/bin/composer
|
||||||
|
COPY composer.local.json w/composer.local.json
|
||||||
|
|
||||||
|
RUN cd /var/www/html/w && composer update --no-dev
|
||||||
|
|
||||||
COPY config.json /docker-entrypoint.d/config.json
|
COPY config.json /docker-entrypoint.d/config.json
|
||||||
|
|
26
mediawiki/README.md
Normal file
26
mediawiki/README.md
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
# MediaWiki OCI image
|
||||||
|
|
||||||
|
This MediaWiki OCI image is based on NGINX Unit and bundles several extensions, which are in use in wiki.ccchb.de.
|
||||||
|
|
||||||
|
## Bundled extensions
|
||||||
|
|
||||||
|
* MobileFrontend
|
||||||
|
* PluggableAuth
|
||||||
|
* OpenIDConnect
|
||||||
|
* Widgets
|
||||||
|
|
||||||
|
## Ingress
|
||||||
|
|
||||||
|
The image exposes an HTTP service under port 80.
|
||||||
|
The MediaWiki installation is available below `/w/` and provides article paths below the path `/wiki/`.
|
||||||
|
A redirect at `/` is not provided by the image, and has to be implemented by the ingress.
|
||||||
|
|
||||||
|
## Volumes
|
||||||
|
|
||||||
|
It is recommended to mount a volume at `/var/www/html/w/images/` for MediaWiki uploads.
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
The MediaWiki installation expects a LocalSettings.php configuration file at the path `/var/www/html/w/LocalSettings.php`.
|
||||||
|
|
||||||
|
Happy helming!
|
7
mediawiki/composer.local.json
Normal file
7
mediawiki/composer.local.json
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{
|
||||||
|
"extra": {
|
||||||
|
"merge-plugin": {
|
||||||
|
"include": ["extensions/*/composer.json", "skins/*/composer.json"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,42 +8,56 @@
|
||||||
{
|
{
|
||||||
"match": {
|
"match": {
|
||||||
"uri": [
|
"uri": [
|
||||||
"/w/index.php",
|
"/w/index.php*",
|
||||||
"/w/load.php",
|
"/w/load.php*",
|
||||||
"/w/api.php",
|
"/w/api.php*",
|
||||||
"/w/thumb.php",
|
"/w/thumb.php*",
|
||||||
"/w/opensearch_desc.php",
|
"/w/opensearch_desc.php*",
|
||||||
"/w/rest.php",
|
"/w/rest.php*",
|
||||||
"/w/img_auth.php",
|
"/w/img_auth.php*"
|
||||||
"/w/rest.php/*",
|
|
||||||
"/w/mw-config/*.php"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"action": {
|
"action": {
|
||||||
"pass": "applications/php_app"
|
"pass": "applications/php_app/direct"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"match": {
|
"match": {
|
||||||
"uri": [
|
"uri": [
|
||||||
|
"!*.php",
|
||||||
"/w/images/*",
|
"/w/images/*",
|
||||||
"/w/resources/assets/*",
|
"/w/resources/assets/*",
|
||||||
"/w/resources/lib/*",
|
"/w/resources/lib/*",
|
||||||
"/w/resources/src/*",
|
"/w/resources/src/*",
|
||||||
"/w/extensions/*",
|
"/w/extensions/*",
|
||||||
"/w/skins/*",
|
"/w/skins/*"
|
||||||
"favicon.ico"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"action": {
|
"action": {
|
||||||
"share": "/var/www/html$uri"
|
"share": "/var/www/html$uri"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"match": {
|
||||||
|
"uri": ["/wiki/*"]
|
||||||
|
},
|
||||||
|
"action": {
|
||||||
|
"pass": "applications/php_app/index"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"applications": {
|
"applications": {
|
||||||
"php_app": {
|
"php_app": {
|
||||||
"type": "php",
|
"type": "php",
|
||||||
"root": "/var/www/html"
|
"targets": {
|
||||||
|
"direct": {
|
||||||
|
"root": "/var/www/html"
|
||||||
|
},
|
||||||
|
"index": {
|
||||||
|
"root": "/var/www/html",
|
||||||
|
"script": "w/index.php"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue