Skip to content

Commit

Permalink
Merge pull request #176 from infosiftr/9.0-rc
Browse files Browse the repository at this point in the history
Add 9.0, "buster" aliases, and use "drupal/recommended-project" layout
  • Loading branch information
tianon committed Aug 6, 2020
2 parents e2c7e05 + 530833e commit e7d2cad
Show file tree
Hide file tree
Showing 18 changed files with 477 additions and 81 deletions.
3 changes: 0 additions & 3 deletions 7/apache/Dockerfile → 7/apache-buster/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# from https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements
FROM php:7.4-apache-buster
# TODO switch to buster once https://github.com/docker-library/php/issues/865 is resolved in a clean way (either in the PHP image or in PHP itself)

# install the PHP extensions we need
RUN set -eux; \
Expand Down Expand Up @@ -57,8 +56,6 @@ RUN { \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

WORKDIR /var/www/html

# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 7.72
ENV DRUPAL_MD5 ed967195ce0e78bf2ab7245aaf0649d6
Expand Down
4 changes: 1 addition & 3 deletions 7/fpm-alpine/Dockerfile → 7/fpm-alpine3.12/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# from https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements
FROM php:7.4-fpm-alpine
FROM php:7.4-fpm-alpine3.12

# install the PHP extensions we need
# postgresql-dev is needed for https://bugs.alpinelinux.org/issues/3642
Expand Down Expand Up @@ -46,8 +46,6 @@ RUN { \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

WORKDIR /var/www/html

# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 7.72
ENV DRUPAL_MD5 ed967195ce0e78bf2ab7245aaf0649d6
Expand Down
3 changes: 0 additions & 3 deletions 7/fpm/Dockerfile → 7/fpm-buster/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# from https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements
FROM php:7.4-fpm-buster
# TODO switch to buster once https://github.com/docker-library/php/issues/865 is resolved in a clean way (either in the PHP image or in PHP itself)

# install the PHP extensions we need
RUN set -eux; \
Expand Down Expand Up @@ -57,8 +56,6 @@ RUN { \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

WORKDIR /var/www/html

# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 7.72
ENV DRUPAL_MD5 ed967195ce0e78bf2ab7245aaf0649d6
Expand Down
18 changes: 10 additions & 8 deletions 8.8/apache/Dockerfile → 8.8/apache-buster/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# from https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements
FROM php:7.4-apache-buster
# TODO switch to buster once https://github.com/docker-library/php/issues/865 is resolved in a clean way (either in the PHP image or in PHP itself)

# install the PHP extensions we need
RUN set -eux; \
Expand Down Expand Up @@ -57,17 +56,20 @@ RUN { \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

WORKDIR /var/www/html
# https://github.com/drupal/drupal/blob/9.0.1/composer.lock#L4052-L4053
COPY --from=composer:1.10 /usr/bin/composer /usr/local/bin/

# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 8.8.8
ENV DRUPAL_MD5 c8265f0228ca0306de7b2755e4731a3d

WORKDIR /opt/drupal
RUN set -eux; \
curl -fSL "https://ftp.drupal.org/files/projects/drupal-${DRUPAL_VERSION}.tar.gz" -o drupal.tar.gz; \
echo "${DRUPAL_MD5} *drupal.tar.gz" | md5sum -c -; \
tar -xz --strip-components=1 -f drupal.tar.gz; \
rm drupal.tar.gz; \
chown -R www-data:www-data sites modules themes
export COMPOSER_HOME="$(mktemp -d)"; \
composer create-project --no-interaction "drupal/recommended-project:$DRUPAL_VERSION" ./; \
chown -R www-data:www-data web/sites web/modules web/themes; \
rmdir /var/www/html; \
ln -sf /opt/drupal/web /var/www/html; \
# delete composer cache
rm -rf "$COMPOSER_HOME"

# vim:set ft=dockerfile:
19 changes: 11 additions & 8 deletions 8.8/fpm-alpine/Dockerfile → 8.8/fpm-alpine3.12/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# from https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements
FROM php:7.4-fpm-alpine
FROM php:7.4-fpm-alpine3.12

# install the PHP extensions we need
# postgresql-dev is needed for https://bugs.alpinelinux.org/issues/3642
Expand Down Expand Up @@ -46,17 +46,20 @@ RUN { \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

WORKDIR /var/www/html
# https://github.com/drupal/drupal/blob/9.0.1/composer.lock#L4052-L4053
COPY --from=composer:1.10 /usr/bin/composer /usr/local/bin/

# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 8.8.8
ENV DRUPAL_MD5 c8265f0228ca0306de7b2755e4731a3d

WORKDIR /opt/drupal
RUN set -eux; \
curl -fSL "https://ftp.drupal.org/files/projects/drupal-${DRUPAL_VERSION}.tar.gz" -o drupal.tar.gz; \
echo "${DRUPAL_MD5} *drupal.tar.gz" | md5sum -c -; \
tar -xz --strip-components=1 -f drupal.tar.gz; \
rm drupal.tar.gz; \
chown -R www-data:www-data sites modules themes
export COMPOSER_HOME="$(mktemp -d)"; \
composer create-project --no-interaction "drupal/recommended-project:$DRUPAL_VERSION" ./; \
chown -R www-data:www-data web/sites web/modules web/themes; \
rmdir /var/www/html; \
ln -sf /opt/drupal/web /var/www/html; \
# delete composer cache
rm -rf "$COMPOSER_HOME"

# vim:set ft=dockerfile:
75 changes: 75 additions & 0 deletions 8.8/fpm-buster/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# from https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements
FROM php:7.4-fpm-buster

# install the PHP extensions we need
RUN set -eux; \
\
if command -v a2enmod; then \
a2enmod rewrite; \
fi; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libpq-dev \
libzip-dev \
; \
\
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg=/usr \
; \
\
docker-php-ext-install -j "$(nproc)" \
gd \
opcache \
pdo_mysql \
pdo_pgsql \
zip \
; \
\
# 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/*

# 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

# https://github.com/drupal/drupal/blob/9.0.1/composer.lock#L4052-L4053
COPY --from=composer:1.10 /usr/bin/composer /usr/local/bin/

# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 8.8.8

WORKDIR /opt/drupal
RUN set -eux; \
export COMPOSER_HOME="$(mktemp -d)"; \
composer create-project --no-interaction "drupal/recommended-project:$DRUPAL_VERSION" ./; \
chown -R www-data:www-data web/sites web/modules web/themes; \
rmdir /var/www/html; \
ln -sf /opt/drupal/web /var/www/html; \
# delete composer cache
rm -rf "$COMPOSER_HOME"

# vim:set ft=dockerfile:
18 changes: 10 additions & 8 deletions 8.9/apache/Dockerfile → 8.9/apache-buster/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# from https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements
FROM php:7.4-apache-buster
# TODO switch to buster once https://github.com/docker-library/php/issues/865 is resolved in a clean way (either in the PHP image or in PHP itself)

# install the PHP extensions we need
RUN set -eux; \
Expand Down Expand Up @@ -57,17 +56,20 @@ RUN { \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

WORKDIR /var/www/html
# https://github.com/drupal/drupal/blob/9.0.1/composer.lock#L4052-L4053
COPY --from=composer:1.10 /usr/bin/composer /usr/local/bin/

# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 8.9.2
ENV DRUPAL_MD5 f3f64fbef97831efd1c943f392975f45

WORKDIR /opt/drupal
RUN set -eux; \
curl -fSL "https://ftp.drupal.org/files/projects/drupal-${DRUPAL_VERSION}.tar.gz" -o drupal.tar.gz; \
echo "${DRUPAL_MD5} *drupal.tar.gz" | md5sum -c -; \
tar -xz --strip-components=1 -f drupal.tar.gz; \
rm drupal.tar.gz; \
chown -R www-data:www-data sites modules themes
export COMPOSER_HOME="$(mktemp -d)"; \
composer create-project --no-interaction "drupal/recommended-project:$DRUPAL_VERSION" ./; \
chown -R www-data:www-data web/sites web/modules web/themes; \
rmdir /var/www/html; \
ln -sf /opt/drupal/web /var/www/html; \
# delete composer cache
rm -rf "$COMPOSER_HOME"

# vim:set ft=dockerfile:
65 changes: 65 additions & 0 deletions 8.9/fpm-alpine3.12/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# from https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements
FROM php:7.4-fpm-alpine3.12

# install the PHP extensions we need
# postgresql-dev is needed for https://bugs.alpinelinux.org/issues/3642
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
coreutils \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libzip-dev \
postgresql-dev \
; \
\
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg=/usr/include \
; \
\
docker-php-ext-install -j "$(nproc)" \
gd \
opcache \
pdo_mysql \
pdo_pgsql \
zip \
; \
\
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .drupal-phpexts-rundeps $runDeps; \
apk del .build-deps

# 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

# https://github.com/drupal/drupal/blob/9.0.1/composer.lock#L4052-L4053
COPY --from=composer:1.10 /usr/bin/composer /usr/local/bin/

# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 8.9.2

WORKDIR /opt/drupal
RUN set -eux; \
export COMPOSER_HOME="$(mktemp -d)"; \
composer create-project --no-interaction "drupal/recommended-project:$DRUPAL_VERSION" ./; \
chown -R www-data:www-data web/sites web/modules web/themes; \
rmdir /var/www/html; \
ln -sf /opt/drupal/web /var/www/html; \
# delete composer cache
rm -rf "$COMPOSER_HOME"

# vim:set ft=dockerfile:
18 changes: 10 additions & 8 deletions 8.9/fpm/Dockerfile → 8.9/fpm-buster/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# from https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements
FROM php:7.4-fpm-buster
# TODO switch to buster once https://github.com/docker-library/php/issues/865 is resolved in a clean way (either in the PHP image or in PHP itself)

# install the PHP extensions we need
RUN set -eux; \
Expand Down Expand Up @@ -57,17 +56,20 @@ RUN { \
echo 'opcache.fast_shutdown=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

WORKDIR /var/www/html
# https://github.com/drupal/drupal/blob/9.0.1/composer.lock#L4052-L4053
COPY --from=composer:1.10 /usr/bin/composer /usr/local/bin/

# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION 8.9.2
ENV DRUPAL_MD5 f3f64fbef97831efd1c943f392975f45

WORKDIR /opt/drupal
RUN set -eux; \
curl -fSL "https://ftp.drupal.org/files/projects/drupal-${DRUPAL_VERSION}.tar.gz" -o drupal.tar.gz; \
echo "${DRUPAL_MD5} *drupal.tar.gz" | md5sum -c -; \
tar -xz --strip-components=1 -f drupal.tar.gz; \
rm drupal.tar.gz; \
chown -R www-data:www-data sites modules themes
export COMPOSER_HOME="$(mktemp -d)"; \
composer create-project --no-interaction "drupal/recommended-project:$DRUPAL_VERSION" ./; \
chown -R www-data:www-data web/sites web/modules web/themes; \
rmdir /var/www/html; \
ln -sf /opt/drupal/web /var/www/html; \
# delete composer cache
rm -rf "$COMPOSER_HOME"

# vim:set ft=dockerfile:

0 comments on commit e7d2cad

Please sign in to comment.