-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-8-debian.template
104 lines (97 loc) · 2.96 KB
/
Dockerfile-8-debian.template
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
# from 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 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 \
default-libmysqlclient-dev \
libfontconfig1 \
libgmp-dev \
libxext6 \
; \
\
docker-php-ext-configure gd \
--with-freetype-dir=/usr \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
; \
\
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 '/=>/ { 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; \
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/*
# 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'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini ; \
{ \
echo 'log_errors = On'; \
echo 'error_log = /dev/stdout'; \
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
COPY --from=composer:%%COMPOSER_VERSION%% /usr/bin/composer /usr/local/bin/
ENV PATH=/usr/local/bin:${PATH}
# https://www.drupal.org/node/3060/release
ENV DRUPAL_VERSION %%VERSION%%
ENV DRUPAL_MD5 %%MD5%%
ENV DRUSH_VERSION %%DRUSH_VERSION%%
WORKDIR /var/www/html
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; \
COMPOSER_MEMORY_LIMIT=-1 composer install; \
COMPOSER_MEMORY_LIMIT=-1 composer require drush/drush {{ .drush.version }}; \
COMPOSER_MEMORY_LIMIT=-1 composer require michelf/php-markdown; \
chown -R www-data:www-data sites modules themes
ENV PATH=${PATH}:/var/www/html/vendor/bin
# vim:set ft=dockerfile: