-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-6-debian-php83.template
More file actions
154 lines (142 loc) · 5.71 KB
/
Dockerfile-6-debian-php83.template
File metadata and controls
154 lines (142 loc) · 5.71 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#
# 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:%%PHP_VERSION%%
# install the PHP extensions we need
RUN set -eux; \
\
if command -v a2enmod; then \
a2enmod expires rewrite; \
fi; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libpq-dev \
libwebp-dev \
libzip-dev \
# sts for mysql-client
default-libmysqlclient-dev \
libfontconfig1 \
libgmp-dev \
libxext6 \
; \
\
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg=/usr \
--with-webp \
; \
\
docker-php-ext-install -j "$(nproc)" \
gd \
opcache \
pdo_mysql \
pdo_pgsql \
zip \
bcmath \
gmp \
mysqli \
; \
\
# 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 '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); printf "*%s\n", so }' \
| 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; \
apt-get install -y --no-install-recommends curl tidy default-mysql-client vim git msmtp msmtp-mta libfontconfig1 libxext6 wget unzip zip; \
rm -rf /var/lib/apt/lists/*
# ADD Variables DRUPAL_SUBDIR, APACHE_UID, APACHE_GID
COPY ./docker-php-entrypoint /usr/local/bin/docker-php-entrypoint
# 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.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini ; \
{ \
echo 'log_errors = On'; \
echo 'error_log = /dev/stdout'; \
echo 'expose_php = Off'; \
echo 'sendmail_path="/usr/bin/msmtp --file /etc/msmtprc -t -i"'; \
echo 'display_errors="stdout"'; \
echo 'upload_max_filesize = "3M"'; \
echo 'post_max_size = "20M"'; \
} > /usr/local/etc/php/conf.d/php-overwrite.ini; \
{ \
echo 'host example.com'; \
echo 'from server@localhost'; \
echo 'maildomain example.com'; \
echo 'syslog off'; \
} > /etc/msmtprc
# https://www.drupal.org/node/3298550
# Drupal now recommends sites enable PHP output buffering by default, if PHP is run as a server module
# e.g. with Apache's mod_php
RUN { \
echo 'output_buffering=true'; \
} > /usr/local/etc/php/conf.d/docker-php-drupal-recommended.ini
COPY --from=composer:%%COMPOSER_VERSION%% /usr/bin/composer /usr/local/bin/
ENV PATH=/usr/local/bin:${PATH}
# 2025-03-19: https://www.drupal.org/project/drupal/releases/10.3.14
ENV DRUPAL_VERSION=%%VERSION%%
ENV DRUPAL_MD5=%%MD5%%
ENV DRUSH_VERSION=%%DRUSH_VERSION%%
ENV DRUPAL_COMPOSER_MODULES=""
# 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
#CMD ["apache2-foreground"]
# PRE Routines before official start
COPY ./apache2-pre-start-drupal /usr/local/bin/apache2-pre-start-drupal
CMD ["apache2-pre-start-drupal"]
# Contrib-Modules via docker-compose DRUPAL_COMPOSER_MODULES
ENV PATH=${PATH}:/opt/drupal/vendor/bin
#RUN 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 ; \
# git clone https://git.drupal.org/project/d6lts.git \
# ; patch -p1 < d6lts/common/core/SA-CORE-2018-001.patch \
# ; patch -p1 < d6lts/common/core/SA-CORE-2018-002.patch \
# ; patch -p1 < d6lts/common/core/SA-CORE-2018-002-bugfix1.patch \
# ; patch -p1 < d6lts/common/core/SA-CORE-2018-004.patch \
# ; patch -p1 < d6lts/common/core/SA-CORE-2018-006.patch \
# ; patch -p1 < d6lts/common/core/SA-CORE-2019-002.patch \
# ; patch -p1 < d6lts/common/core/SA-CORE-2019-006.patch \
# ; echo "*** Drupal CORE patched."
## && patch -p1 -d sites/all/modules/filefield < d6lts/common/contrib/filefield/SA-CORE-2018-004.patch ; \
## && patch -p1 -d sites/all/modules/lightbox2 < d6lts/common/contrib/lightbox2/SA-CONTRIB-2018-064.patch ; \
## && patch -p1 -d sites/all/modules/password_policy < d6lts/common/contrib/password_policy/sa-contrib-2018-077.patch \
## && patch -p1 -d sites/all/modules/print < d6lts/common/contrib/print/SA-CONTRIB-2018-063.patch ; \
## && patch -p1 -d sites/all/modules/session_limit < d6lts/common/contrib/session_limit/SA-CONTRIB-2018-072.patch ; \
## && patch -p1 -d sites/all/modules/views < d6lts/common/contrib/views/SA-CONTRIB-2014-054-6.x-2.x.patch ; \
## && patch -p1 -d sites/all/modules/views < d6lts/common/contrib/views/SA-CONTRIB-2016-036-6.x-2.x.patch ; \
## && patch -p1 -d sites/all/modules/views < d6lts/common/contrib/views/SA-CONTRIB-2017-022.patch ; \
## && patch -p1 -d sites/all/modules/views < d6lts/common/contrib/views/SA-CONTRIB-2017-068-6.x-2.x.patch ; \
RUN git clone https://github.com/neffets/Drupal6-LTS.git ./; \
COMPOSER_MEMORY_LIMIT=-1 composer require drush/drush ${DRUSH_VERSION}; \
COMPOSER_MEMORY_LIMIT=-1 composer install; \
chown -R www-data:www-data sites modules themes
# vim:set ft=dockerfile: