-
Notifications
You must be signed in to change notification settings - Fork 204
/
Copy pathDockerfile
82 lines (73 loc) · 2.34 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#
# NOTE: THIS DOCKERFILE IS GENERATED VIA "apply-templates.sh"
#
# PLEASE DO NOT EDIT IT DIRECTLY.
#
# https://www.drupal.org/docs/system-requirements/php-requirements
FROM php:8.3-fpm-alpine3.21
# install the PHP extensions we need
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
coreutils \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
libzip-dev \
# postgresql-dev is needed for https://bugs.alpinelinux.org/issues/3642
postgresql-dev \
; \
\
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg=/usr/include \
--with-webp \
; \
\
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 --no-network --virtual .drupal-phpexts-rundeps $runDeps; \
apk del --no-network .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'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/
# 2025-03-19: https://www.drupal.org/project/drupal/releases/11.1.5
ENV DRUPAL_VERSION 11.1.5
# https://github.com/docker-library/drupal/pull/259
# https://github.com/moby/buildkit/issues/4503
# https://github.com/composer/composer/issues/11839
# https://github.com/composer/composer/issues/11854
# https://github.com/composer/composer/blob/94fe2945456df51e122a492b8d14ac4b54c1d2ce/src/Composer/Console/Application.php#L217-L218
ENV COMPOSER_ALLOW_SUPERUSER 1
WORKDIR /opt/drupal
RUN set -eux; \
export COMPOSER_HOME="$(mktemp -d)"; \
composer create-project --no-interaction "drupal/recommended-project:$DRUPAL_VERSION" ./; \
# https://github.com/docker-library/drupal/pull/266#issuecomment-2273985526
composer check-platform-reqs; \
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"
ENV PATH=${PATH}:/opt/drupal/vendor/bin
# vim:set ft=dockerfile: