-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
69 lines (59 loc) · 2.12 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
FROM php:7.2-apache
# Enable Apache Rewrite + Expires Module
RUN a2enmod rewrite expires
# Install dependencies
RUN apt-get update && apt-get install -y \
unzip \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libyaml-dev \
&& docker-php-ext-install opcache \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install zip
# 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=2'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
echo 'upload_max_filesize=128M'; \
echo 'post_max_size=128M'; \
} > /usr/local/etc/php/conf.d/php-recommended.ini
RUN pecl install apcu \
&& pecl install yaml \
&& pecl install xdebug
RUN { \
echo "extension=apcu.so"; \
echo "extension=yaml.so"; \
echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)"; \
echo '[XDebug]'; \
echo 'xdebug.default_enable=1'; \
echo 'xdebug.remote_autostart=1'; \
echo 'xdebug.remote_connect_back=0'; \
echo 'xdebug.remote_enable=1'; \
echo 'xdebug.remote_host=host.docker.internal'; \
echo 'xdebug.remote_log=/tmp/xdebug.log'; \
echo 'xdebug.remote_port=9073'; \
} > /usr/local/etc/php/conf.d/php-recommended.ini
# Set user to www-data
RUN chown www-data:www-data /var/www
USER www-data
# Define Grav version and expected SHA1 signature
ENV GRAV_VERSION 1.6.15
ENV GRAV_SHA1 ac2a5dff69c4171aea7a0412420aac439f80dd14
# Install grav
WORKDIR /var/www
RUN curl -o grav-admin.zip -SL https://getgrav.org/download/core/grav-admin/${GRAV_VERSION} && \
echo "$GRAV_SHA1 grav-admin.zip" | sha1sum -c - && \
unzip grav-admin.zip && \
mv -T /var/www/grav-admin /var/www/html && \
rm grav-admin.zip
# Install login plugin
RUN cd /var/www/html && bin/gpm install login
# Return to root user
USER root