-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
43 lines (36 loc) · 1.64 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
FROM drupal:11
# install the PHP extensions we need
RUN apt-get update \
&& apt-get install -y git mariadb-client wget nano pv gpg \
&& rm -rf /var/lib/apt/lists/*
# install Xdebug, from https://xdebug.org/docs/install
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug
# enable Xdebug remote debugging
RUN { \
echo 'xdebug.mode=debug'; \
echo 'xdebug.discover_client_host=true'; \
echo 'xdebug.client_host=host.docker.internal'; \
echo 'xdebug.start_with_request=yes'; \
echo 'memory_limit = 2048M'; \
echo 'error_log = /var/log/php_error.log'; \
echo 'xdebug.log = /var/log/xdebug.log'; \
} >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
# install phpredis extension
ENV PHPREDIS_VERSION 6.0.2
RUN curl -L -o /tmp/redis.tar.gz https://github.com/phpredis/phpredis/archive/$PHPREDIS_VERSION.tar.gz \
&& tar xfz /tmp/redis.tar.gz \
&& rm -r /tmp/redis.tar.gz \
&& mkdir /usr/src/php/ext -p \
&& mv phpredis-$PHPREDIS_VERSION /usr/src/php/ext/redis \
&& docker-php-ext-install redis
# install and config mhsendmail for mailhog, from https://devilbox.readthedocs.io/en/latest/custom-container/enable-mailhog.html#tl-dr
RUN curl -fSL "https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64" -o mhsendmail \
&& chmod +x mhsendmail \
&& mv mhsendmail /usr/local/bin/ \
&& echo "sendmail_path = '/usr/local/bin/mhsendmail --smtp-addr=\"mailhog:1025\"'" >> /usr/local/etc/php/conf.d/mailhog.ini
# preemptively creates log files, and give them to www-data
RUN cd /var/log \
&& touch php_error.log xdebug.log \
&& chown 1001:1001 php_error.log xdebug.log
ENV TERM xterm