Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 committed May 21, 2024
1 parent 31aaa10 commit 8c61813
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 44 deletions.
12 changes: 12 additions & 0 deletions dockers/femiwiki/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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/"]
Expand Down
45 changes: 1 addition & 44 deletions dockers/mediawiki/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 8c61813

Please sign in to comment.