add mediawiki

This commit is contained in:
Wonderfall 2017-07-29 21:37:39 +02:00
parent f698c17e4c
commit 2b18c3f9b1
5 changed files with 122 additions and 0 deletions

37
mediawiki/Dockerfile Normal file
View File

@ -0,0 +1,37 @@
FROM wonderfall/nginx-php:7.1
ARG MEDIAWIKI_VER=1.29
ARG SUB_VERSION=0
ENV UID=991 GID=991 \
UPLOAD_MAX_SIZE=10M \
MEMORY_LIMIT=128M
RUN apk -U add \
tar \
libressl \
ca-certificates \
git \
coreutils \
diffutils \
build-base \
autoconf \
&& pecl install apcu \
&& mkdir mediawiki && cd mediawiki \
&& wget -qO- https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_VER}/mediawiki-${MEDIAWIKI_VER}.${SUB_VERSION}.tar.gz | tar xz --strip 1 \
&& apk del build-base autoconf \
&& rm -rf /var/cache/apk/*
COPY rootfs /
RUN chmod +x /usr/local/bin/run.sh /etc/s6.d/*/* /etc/s6.d/.s6-svscan/*
VOLUME /config /skins /extensions /mediawiki/images /php/session
EXPOSE 8888
LABEL maintainer="Wonderfall <wonderfall@targaryen.house>" \
description="MediaWiki is a free software open source wiki package written in PHP" \
version="MediaWiki ${MEDIAWIKI_VER}.${SUB_VERSION}"
CMD ["run.sh"]

24
mediawiki/README.md Normal file
View File

@ -0,0 +1,24 @@
## wonderfall/freshrss
A free, self-hostable aggregator : https://github.com/FreshRSS/FreshRSS
#### Features
- Based on Alpine Linux (wonderfall/nginx-php image)
- Bundled with nginx and PHP7.1.
- Automatic feed update (frequency at 30 minutes by default)
#### Build-time variables
- **FRESHRSS_VER** : version of FreshRSS
#### Environment variables
- **UID** : user id
- **GID** : group id
- **MEMORY_LIMIT** : php memory limit *(default : 128M)*
- **UPLOAD_MAX_SIZE** : maximum upload size *(default : 10M)*
- **CRON_PERIOD** : feed update frequency *(default : 30m)*
#### Volumes
- **/freshrss/data**
#### Ports
- **8888** [(reverse proxy!)](https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration)

View File

@ -0,0 +1,42 @@
server {
listen 8888;
root /mediawiki;
index index.php index.html;
client_body_timeout 60;
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
try_files $uri /index.php;
expires max;
log_not_found off;
}
location ^~ /cache/ {
deny all;
}
location /dumps {
root /mediawiki/local;
}
location / {
try_files $uri $uri/ @rewrite;
}
location @rewrite {
rewrite ^/(.*)$ /index.php?title=$1&$args;
}
location ^~ /maintenance/ {
return 403;
}
location ^~ /images/ {}
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_pass unix:/php/run/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /nginx/conf/fastcgi_params;
}
}

View File

@ -0,0 +1,4 @@
extension=apcu.so
apc.enabled=1
apc.shm_size=<APC_SHM_SIZE>
apc.ttl=7200

View File

@ -0,0 +1,15 @@
#!/bin/sh
sed -i -e "s/<UPLOAD_MAX_SIZE>/$UPLOAD_MAX_SIZE/g" /nginx/conf/nginx.conf /php/etc/php-fpm.conf \
-e "s/<MEMORY_LIMIT>/$MEMORY_LIMIT/g" /php/etc/php-fpm.conf \
-e "s/<APC_SHM_SIZE>/$APC_SHM_SIZE/g" /php/conf.d/apcu.ini
chown -R $UID:$GID /mediawiki /nginx /php /tmp /etc/s6.d
if [ -f /config/LocalSettings.php ] && [ ! -f /mediawiki/LocalSettings.php ]; then
ln -s /config/LocalSettings.php /mediawiki/LocalSettings.php
fi
cp -r /skins/* /mediawiki/skins/
cp -r /extensions/* /mediawiki/extensions/
exec su-exec $UID:$GID /bin/s6-svscan /etc/s6.d