Skip to content

Commit

Permalink
Improve docker layers
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 committed May 21, 2024
1 parent ffd5c4e commit 5b27cd1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
22 changes: 18 additions & 4 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/mediawiki:1.1.0
FROM --platform=$TARGETPLATFORM ghcr.io/femiwiki/femiwiki-extensions:1.1.1 AS extensions

FROM --platform=$TARGETPLATFORM ghcr.io/femiwiki/mediawiki:2.0.0

# Set timezone
ENV TZ=Asia/Seoul
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Install Mediawiki and extensions
RUN mv /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 @@ -23,14 +30,21 @@ RUN mkdir -p \
/etc/caddy \
/usr/share/caddy

# Install MediaWiki
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

# Web server should be able to write 'extensions/Widgets/compiled_templates'
# directory Required by 'Widgets' extension
# Reference: https://www.mediawiki.org/wiki/Extension:Widgets
RUN chmod o+w /srv/femiwiki.com/extensions/Widgets/compiled_templates

# 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/"]
RUN mkdir /mediawiki/

EXPOSE 80
EXPOSE 443
Expand Down
8 changes: 7 additions & 1 deletion dockers/femiwiki/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# femiwiki

## 1.1.1

- Bump femiwiki/mediawiki to v2.0.0
- Run Composer
- Download extensions from femiwiki/femiwiki-extensions v1.1.0

## 1.1.0

- Bump mediawiki to v1.1.0
- Bump femiwiki/mediawiki to v1.1.0
File renamed without changes.

0 comments on commit 5b27cd1

Please sign in to comment.