Skip to content

Commit

Permalink
Merge pull request #74 from FriendsOfREDAXO/schuer-patch-1
Browse files Browse the repository at this point in the history
Patches
  • Loading branch information
schuer authored Dec 27, 2023
2 parents 8b5ee0f + 8ba0914 commit 300e4a4
Show file tree
Hide file tree
Showing 9 changed files with 535 additions and 538 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
- "images/**/*"
# add workflow dispatch to manually publish the current images
workflow_dispatch:
pull_request:
paths:
- "images/**/*"

concurrency:
# Cancel in-progress jobs if a new job is trigged by a commit from the same branch
Expand Down Expand Up @@ -67,8 +64,8 @@ jobs:
run: |
taglist=$(yq 'map(
(
"friendsofredaxo/redaxo",
"ghcr.io/friendsofredaxo/redaxo"
"${{ env.REGISTRY_IMAGE }}",
"ghcr.io/${{ env.REGISTRY_IMAGE }}"
)
+ ":" + .[]) | to_csv' ./images/${{ matrix.image }}/tags.yml)
echo "$taglist"
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ We provide two image variants:
- **Stable:** `5-stable`, `5`
Contains the latest stable REDAXO 5.x version and the lowest PHP version with [active support](https://www.php.net/supported-versions.php).
- **Edge:** `5-edge`
Contains the latest REDAXO 5.x, even beta versions, and the latest PHP, even RC versions.
Use this image for development and testing.
Contains the latest REDAXO 5.x, even beta versions, and the latest PHP, even RC versions.
Use this image for development and testing.

If you’re not sure, you probably want to go for `friendsofredaxo/redaxo:5` 🚀

Expand Down
174 changes: 87 additions & 87 deletions images/5-edge/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,115 +2,115 @@ FROM php:8.3-apache

# install persistent PHP extensions (they won’t get purged afterwards)
RUN set -eux; \
apt-get update; \
apt-get install -y --quiet --no-install-recommends \
ghostscript \
locales \
unzip \
; \
rm -rf /var/lib/apt/lists/*
apt-get update; \
apt-get install -y --quiet --no-install-recommends \
ghostscript \
locales \
unzip \
; \
rm -rf /var/lib/apt/lists/*

# generate locales
RUN set -eux; \
echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "en_GB.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "es_ES.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "it_IT.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "nl_NL.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "pt_BR.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "sv_SE.UTF-8 UTF-8" >> /etc/locale.gen; \
locale-gen
echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "en_GB.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "es_ES.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "it_IT.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "nl_NL.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "pt_BR.UTF-8 UTF-8" >> /etc/locale.gen; \
echo "sv_SE.UTF-8 UTF-8" >> /etc/locale.gen; \
locale-gen

# install PHP extensions
RUN set -ex; \
\
# mark packages as being manually installed
# see https://manpages.debian.org/stretch/apt/apt-mark.8.en.html
savedAptMark="$(apt-mark showmanual)"; \
\
# install via apt-get
# see https://manpages.debian.org/stretch/apt/apt-get.8.en.html
apt-get update; \
apt-get install -y --quiet --no-install-recommends \
libfreetype6-dev \
libjpeg-dev \
libmagickwand-dev \
libmcrypt-dev \
libpng-dev \
libwebp-dev \
libavif-dev \
libzip-dev \
; \
# install developer extensions
apt-get install -y --quiet --no-install-recommends \
git \
msmtp \
msmtp-mta \
; \
# install and configure via docker-php-ext
# see https://github.com/docker-library/docs/tree/master/php#how-to-install-more-php-extensions
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp \
--with-avif \
; \
docker-php-ext-install -j "$(nproc)" \
exif \
gd \
intl \
pdo_mysql \
zip \
; \
# install imagick
# https://pecl.php.net/package/imagick
# pecl install imagick-3.7.0; \
# docker-php-ext-enable imagick; \
# rm -r /tmp/pear; \
# \
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
# see https://github.com/docker-library/wordpress/blob/master/Dockerfile.template
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \
| xargs -r dpkg-query --search \
| 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/*
\
# mark packages as being manually installed
# see https://manpages.debian.org/stretch/apt/apt-mark.8.en.html
savedAptMark="$(apt-mark showmanual)"; \
\
# install via apt-get
# see https://manpages.debian.org/stretch/apt/apt-get.8.en.html
apt-get update; \
apt-get install -y --quiet --no-install-recommends \
libfreetype6-dev \
libjpeg-dev \
libmagickwand-dev \
libmcrypt-dev \
libpng-dev \
libwebp-dev \
libavif-dev \
libzip-dev \
; \
# install developer extensions
apt-get install -y --quiet --no-install-recommends \
git \
msmtp \
msmtp-mta \
; \
# install and configure via docker-php-ext
# see https://github.com/docker-library/docs/tree/master/php#how-to-install-more-php-extensions
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp \
--with-avif \
; \
docker-php-ext-install -j "$(nproc)" \
exif \
gd \
intl \
pdo_mysql \
zip \
; \
# install imagick
# https://pecl.php.net/package/imagick
# pecl install imagick-3.7.0; \
# docker-php-ext-enable imagick; \
# rm -r /tmp/pear; \
# \
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
# see https://github.com/docker-library/wordpress/blob/master/Dockerfile.template
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \
| xargs -r dpkg-query --search \
| 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/*

# install composer
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer

# enable OPcache
# see https://secure.php.net/manual/en/opcache.installation.php
RUN set -eux; \
docker-php-ext-enable opcache; \
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
docker-php-ext-enable opcache; \
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

# enable apache modules
RUN set -eux; \
a2enmod expires headers rewrite ssl
a2enmod expires headers rewrite ssl

# create mount point for web root
VOLUME /var/www/html

# fetch REDAXO, validate checksum and extract to tmp folder
RUN set -e; \
curl -Ls -o redaxo.zip https://github.com/redaxo/redaxo/releases/download/5.15.1/redaxo_5.15.1.zip; \
echo "7936b2055b670377be97f8c8a4e90ce46f0a6ad7 *redaxo.zip" | shasum -c -a 256; \
unzip -oq redaxo.zip -d /usr/src/redaxo; \
rm redaxo.zip; \
chown -R www-data:www-data /usr/src/redaxo
curl -Ls -o redaxo.zip https://github.com/redaxo/redaxo/releases/download/5.15.1/redaxo_5.15.1.zip; \
echo "7936b2055b670377be97f8c8a4e90ce46f0a6ad7 *redaxo.zip" | shasum -c -a 256; \
unzip -oq redaxo.zip -d /usr/src/redaxo; \
rm redaxo.zip; \
chown -R www-data:www-data /usr/src/redaxo

# copy and run entrypoint
COPY docker-entrypoint.sh /usr/local/bin/
Expand Down
Loading

0 comments on commit 300e4a4

Please sign in to comment.