Git Product home page Git Product logo

Comments (3)

arthurpsmith avatar arthurpsmith commented on March 29, 2024

Here's the Dockerfile I used most recently for this, I believe it worked (this was back in June 2020).

FROM php:7.3-apache
LABEL maintainer="[email protected]"

System dependencies

RUN set -eux;

apt-get update;
apt-get install -y --no-install-recommends
git
librsvg2-bin
imagemagick
# Required for SyntaxHighlighting
python3
;
rm -rf /var/lib/apt/lists/*

Install the PHP extensions we need

RUN set -eux;

savedAptMark="$(apt-mark showmanual)";

apt-get update;
apt-get install -y --no-install-recommends
libicu-dev
;

docker-php-ext-install -j "$(nproc)"
intl
mbstring
mysqli
opcache
;

pecl install apcu-5.1.18;
docker-php-ext-enable
apcu
;

# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
apt-mark auto '.' > /dev/null;
apt-mark manual $savedAptMark;
ldd "$(php -r 'echo ini_get("extension_dir");')"/
.so
| awk '/=>/ { print $3 }'
| sort -u
| xargs -r dpkg-query -S
| cut -d: -f1
| sort -u
| xargs -rt apt-mark manual;

apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false;
rm -rf /var/lib/apt/lists/*

Enable Short URLs

RUN set -eux;
a2enmod rewrite;
{
echo '<Directory /var/www/html>';
echo ' RewriteEngine On';
echo ' RewriteCond %{REQUEST_FILENAME} !-f';
echo ' RewriteCond %{REQUEST_FILENAME} !-d';
echo ' RewriteRule ^ %{DOCUMENT_ROOT}/index.php [L]';
echo '';
} > "$APACHE_CONFDIR/conf-available/short-url.conf";
a2enconf short-url

set recommended PHP.ini settings

see https://secure.php.net/manual/en/opcache.installation.php

RUN {
echo 'opcache.memory_consumption=128';
echo 'opcache.interned_strings_buffer=8';
echo 'opcache.max_accelerated_files=4000';
echo 'opcache.revalidate_freq=60';
echo 'opcache.fast_shutdown=1';
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

SQLite Directory Setup

RUN set -eux;
mkdir -p /var/www/data;
chown -R www-data:www-data /var/www/data

MediaWiki setup - specify 1.35.0-wmf.38 version

RUN set -eux;
git clone https://gerrit.wikimedia.org/r/mediawiki/core.git --branch wmf/1.35.0-wmf.38 /var/www/html &&
cd /var/www/html &&
git submodule update --init

RUN apt-get update;
apt-get install -q -y curl nodejs npm
RUN npm install npm@latest -g

RUN cd /var/www/html/extensions &&
git clone https://github.com/google/abstracttext.git AbstractText

RUN cd /var/www/html/extensions/AbstractText/eneyj &&
npm install &&
npm install uuid &&
mkdir config &&
mkdir config/runs &&
node src/scripts/labelMap.js &&
cp src/scripts/calibration-initial.json config/calibration.json &&
node src/scripts/measure.js --chatty &&
node src/scripts/calibrate.js

COPY DockerLocalSettings.php /var/www/html/DockerLocalSettings.php
COPY AdditionalLocalSettings.php /tmp/AdditionalLocalSettings.php
COPY admin_passwd /tmp/admin_passwd

RUN cd /var/www/html &&
php maintenance/install.php --server http://localhost:8081 --dbtype sqlite --dbpath /var/www/data --scriptpath "" --passfile /tmp/admin_passwd "Lambda" "admin"
RUN cat /tmp/AdditionalLocalSettings.php >> /var/www/html/LocalSettings.php

RUN cd /var/www/html && php maintenance/update.php

RUN cd /var/www/html &&
php maintenance/importTextFiles.php -s "Import data" --prefix "M:" --overwrite extensions/AbstractText/eneyj/data/Z*

RUN chown -R www-data /var/www/data

from abstracttext.

arminbw avatar arminbw commented on March 29, 2024

@arthurpsmith Thanks. A few things got swallowed when you copy-pasted this. My interpretation (with a few "fixes") is here.

I couldn’t find the 1.35.0-wmf.38 branch you recommended, so I checked out tags/1.35.1 instead.

Now MediaWiki is missing some external dependencies. I guess I have some more reading to do.

from abstracttext.

arminbw avatar arminbw commented on March 29, 2024

However, as this is an abandoned proof-of-concept prototype, I guess it doesn’t make much sense to invest any more time. I wanted to play around with it, when I considered joining the abstract team. As this didn’t work out, I will try to keep an eye on what happens here. Best luck! I hope this project will grow and blossom!

from abstracttext.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.