diff --git a/dockers/femiwiki/Dockerfile b/dockers/femiwiki/Dockerfile index 21a72366..b7546631 100644 --- a/dockers/femiwiki/Dockerfile +++ b/dockers/femiwiki/Dockerfile @@ -8,12 +8,19 @@ # FROM --platform=$TARGETPLATFORM ghcr.io/femiwiki/caddy:1.0.0 AS caddy +FROM --platform=$TARGETPLATFORM ghcr.io/femiwiki/femiwiki-extensions:1.1.1 AS extensions + FROM --platform=$TARGETPLATFORM ghcr.io/femiwiki/mediawiki:1.1.0 # Set timezone ENV TZ=Asia/Seoul RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +# Install Mediawiki and extensions +COPY --from=base-mediawiki --chown=www-data /mediawiki /srv/femiwiki.com/ +COPY --from=extensions /mediawiki/extensions /srv/femiwiki.com/extensions +COPY --from=extensions /mediawiki/skins /srv/femiwiki.com/skins + # Install Caddy COPY --from=caddy /usr/bin/caddy /usr/bin/caddy @@ -28,6 +35,11 @@ RUN mv /mediawiki /srv/femiwiki.com WORKDIR /srv/femiwiki.com +COPY composer.local.json /srv/femiwiki.com + +RUN COMPOSER_HOME=/composer /usr/bin/composer update --no-dev --working-dir /srv/femiwiki.com + + # Ship femiwiki resources COPY --chown=www-data:www-data resources /srv/femiwiki.com/ COPY --chown=www-data:www-data ["site-list.xml", "Hotfix.php", "/a/"] diff --git a/dockers/mediawiki/Dockerfile b/dockers/mediawiki/Dockerfile index c7c58376..21579633 100644 --- a/dockers/mediawiki/Dockerfile +++ b/dockers/mediawiki/Dockerfile @@ -1,54 +1,11 @@ +FROM --platform=$TARGETPLATFORM ghcr.io/femiwiki/php-fpm:1.0.0 ARG MEDIAWIKI_VERSION=1.41.0 -# Composer 이미지는 PHP 버전을 따로 설정할 수 없어 스테이지를 생성해 /usr/bin/composer만 복사해 -# 사용하여야 합니다. -# See 'PHP version & extensions' section on https://hub.docker.com/_/composer for more details. -FROM --platform=$TARGETPLATFORM composer:2.6.6 AS composer - -FROM --platform=$TARGETPLATFORM ghcr.io/femiwiki/femiwiki-extensions:1.1.1 AS extensions - -FROM --platform=$TARGETPLATFORM php:8.1.22-cli AS base-mediawiki -ARG MEDIAWIKI_VERSION - -# Install dependencies and utilities -RUN apt-get update && apt-get install -y \ - libicu-dev \ - # https://getcomposer.org/doc/00-intro.md#system-requirements - git \ - unzip - -# Install the PHP extensions we need -RUN IPE_DEBUG=1 docker-php-ext-install -j8 \ - intl \ - calendar - -COPY --from=composer /usr/bin/composer /usr/bin/composer - -# Create a cache directory for composer -RUN mkdir -p /composer - -COPY --from=extensions /mediawiki /mediawiki - -# Download MediaWiki RUN MEDIAWIKI_MAJOR_VERSION="$(echo $MEDIAWIKI_VERSION | cut -d. -f-2)" &&\ curl -fSL "https://releases.wikimedia.org/mediawiki/${MEDIAWIKI_MAJOR_VERSION}/mediawiki-core-${MEDIAWIKI_VERSION}.tar.gz" -o mediawiki.tar.gz &&\ tar -xzf mediawiki.tar.gz --strip-components=1 --directory /mediawiki/ &&\ rm mediawiki.tar.gz -COPY composer.local.json /mediawiki/ - -RUN COMPOSER_HOME=/composer /usr/bin/composer update --no-dev --working-dir '/mediawiki' - - -# -# PHP-FPM Stage -# - -FROM --platform=$TARGETPLATFORM ghcr.io/femiwiki/php-fpm:1.0.0 - -# Install Mediawiki and extensions -COPY --from=base-mediawiki --chown=www-data /mediawiki /mediawiki - # Create cache directories for mediawiki # $wgCacheDirectory should not be accessible from the web and writable by the web server # See https://www.mediawiki.org/wiki/Manual:$wgCacheDirectory for details