mediawiki/Dockerfile

94 lines
3.3 KiB
Text
Raw Normal View History

2021-09-12 16:33:09 +02:00
FROM mediawiki:1.36
2021-01-12 08:49:20 +01:00
2021-09-12 16:37:40 +02:00
ARG COMPOSER_VERSION=2.1.6
2021-01-12 08:49:20 +01:00
ENV \
WG_SITENAME="Test Wiki" \
WG_SCRIPT_PATH="" \
WG_SERVER="https://wiki.example.com" \
SEMANTIC_URL="wiki.example.com" \
WG_ENABLE_UPLOADS="false" \
WG_ENABLE_EMAIL="false" \
WG_UPLOAD_PATH="/uploads" \
WG_META_NAMESPACE="Meta" \
WG_LANGUAGE_CODE="en" \
MEDIAWIKI_ADMIN_USER="admin" \
MEDIAWIKI_ADMIN_PASS="password" \
WG_DB_TYPE="sqlite" \
WG_DB_SERVER="" \
2021-01-12 12:37:43 +01:00
WG_DB_PORT="" \
2021-01-12 08:49:20 +01:00
WG_DB_NAME="my_wiki" \
2021-01-12 12:37:43 +01:00
WG_DB_USER="mediawiki" \
2021-01-12 08:49:20 +01:00
WG_DB_PASSWORD="password" \
WG_DB_PREFIX="" \
WG_DB_MWSCHEMA="" \
WG_DATABASE_DIR="/var/www/data" \
WG_SECRET_KEY="0000000000000000000000000000000000000000000000000000000000000000" \
WG_EMERGENCY_CONTACT="admin@example.com" \
WG_PASSWORD_SENDER="wiki@example.com" \
ALLOW_PUBLIC_REGISTRATION="false" \
ALLOW_PUBLIC_EDIT="false" \
ALLOW_PUBLIC_READ="true" \
DISABLE_ICONS="false" \
DEBUG="false"
# System dependencies for extensions
RUN set -eu; \
apt-get update; \
apt-get install -y --no-install-recommends \
zip \
unzip \
libpq-dev \
cron \
rclone \
; \
rm -rf /var/lib/apt/lists/*
# PHP extensions
RUN set -eu; \
docker-php-ext-install -j$(nproc) pgsql; \
docker-php-ext-install -j$(nproc) pdo_pgsql
RUN set -eu; \
mkdir /var/www/conf; \
2021-01-12 09:49:30 +01:00
mkdir -p /var/www/html/extensions; \
2021-01-12 08:49:20 +01:00
mkdir -p /var/www/localstore/smwconfig; \
mkdir -p /var/www/localstore/images
# Non-composer based extensions
# JsonConfig required by Graph.
2021-01-12 09:49:30 +01:00
RUN set -eu; \
2021-01-12 08:49:20 +01:00
cd /var/www/html/extensions; \
2021-09-12 16:33:09 +02:00
curl https://extdist.wmflabs.org/dist/extensions/JsonConfig-REL1_36-609a991.tar.gz |tar -xz; \
curl https://extdist.wmflabs.org/dist/extensions/Graph-REL1_36-67b02d1.tar.gz |tar -xz; \
curl https://extdist.wmflabs.org/dist/extensions/SubPageList3-REL1_36-f5d7175.tar.gz |tar -xz; \
curl https://extdist.wmflabs.org/dist/extensions/MsUpload-REL1_36-a6bfb91.tar.gz |tar -xz; \
curl https://extdist.wmflabs.org/dist/extensions/TemplateStyles-REL1_36-b82a604.tar.gz |tar -xz
2021-01-12 08:49:20 +01:00
# Install composer packages
RUN set -eu; \
curl -o /tmp/composer-setup.php https://getcomposer.org/installer; \
curl -o /tmp/composer-setup.sig https://composer.github.io/installer.sig; \
php -r "if (hash('SHA384', file_get_contents('/tmp/composer-setup.php')) !== trim(file_get_contents('/tmp/composer-setup.sig'))) { unlink('/tmp/composer-setup.php'); echo 'Invalid installer' . PHP_EOL; exit(1); }"; \
php /tmp/composer-setup.php --no-ansi --install-dir=/usr/local/bin --filename=composer --version=${COMPOSER_VERSION}; \
rm -rf /tmp/composer-setup.php; \
ln -s /var/www/conf/LocalSettings.local.php /var/www/html/LocalSettings.local.php; \
ln -s /var/www/conf/LocalSettings.php /var/www/html/LocalSettings.php
COPY composer.local.json /var/www/html
RUN composer update --no-dev
# Place config files
COPY conf/* /var/www/conf/
COPY 000-default.conf /etc/apache2/sites-available
# Place our maintenence and setup scripts
COPY scripts/* /usr/local/bin/
RUN chmod 755 /usr/local/bin/*
# Add crontab file in the cron directory
ADD crontab /etc/crontab
RUN chmod 0644 /etc/crontab
2021-09-25 03:24:51 +02:00
# Enable production config
RUN cp /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini