-
Notifications
You must be signed in to change notification settings - Fork 1
/
PHP.Dockerfile
86 lines (73 loc) · 2.33 KB
/
PHP.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
83
84
85
86
ARG DOCKER_FROM_IMAGE=php:8.0-fpm
FROM ${DOCKER_FROM_IMAGE}
ARG PHP_INI_ENVIRONMENT=production
ENV ETC_DIR=/usr/local/etc
ENV PHP_INI_DIR $ETC_DIR/php
ENV PHP_INI_FILE $PHP_INI_DIR/conf.d/moodle-php.ini
RUN echo "Building PHP version: $DOCKER_FROM_IMAGE for $PHP_INI_ENVIRONMENT environment"
# Update and install additional tools
RUN apt-get update && apt-get install --no-install-recommends -y \
zlib1g-dev \
libpng-dev \
libxml2-dev \
libzip-dev \
libxslt-dev \
libldap-dev \
libfreetype-dev \
wget \
libfcgi-bin \
libonig-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/
RUN chmod +x /usr/local/bin/install-php-extensions && \
install-php-extensions \
gd \
xdebug \
xmlrpc \
pdo \
pdo_mysql \
mysqli \
soap \
intl \
zip \
xsl \
opcache \
ldap \
exif \
mbstring
# Only for PHP 8.0+ (remember to remove xmlrpc from list below to use this)
# RUN pecl update-channels && pecl install channel://pecl.php.net/xmlrpc-1.0.0RC3 xmlrpc
# RUN docker-php-ext-install -j$(nproc) xmlrpc
# Install remaining PHP extensions
# RUN docker-php-ext-install \
# pdo \
# pdo_mysql \
# mysqli \
# gd \
# soap \
# intl \
# zip \
# xsl \
# opcache \
# ldap \
# exif \
# mbstring
RUN pecl install -o -f redis \
# xdebug \
&& docker-php-ext-enable redis \
xmlrpc \
# xdebug \
&& rm -rf /tmp/pear
RUN wget --progress=dot:giga -O /usr/local/bin/php-fpm-healthcheck \
https://raw.githubusercontent.com/renatomefi/php-fpm-healthcheck/master/php-fpm-healthcheck \
&& chmod +x /usr/local/bin/php-fpm-healthcheck \
&& wget -O $(which php-fpm-healthcheck) \
https://raw.githubusercontent.com/renatomefi/php-fpm-healthcheck/master/php-fpm-healthcheck \
&& chmod +x $(which php-fpm-healthcheck)
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_FILE"
COPY ./config/php/php.ini "$PHP_INI_DIR/conf.d/moodle-php.ini"
COPY ./config/php/php-fpm.conf "$ETC_DIR/php-fpm.d/moodle.conf"
# Add commands for site maintenance / upgrades
COPY ./openshift/scripts/enable-maintenence.sh /usr/local/bin/enable-maintenence.sh
COPY ./openshift/scripts/moodle-upgrade-job.sh /usr/local/bin/moodle-upgrade-job.sh