Skip to content

Commit 91131f0

Browse files
committed
Add PHP 7.2 support
1 parent acbe716 commit 91131f0

5 files changed

Lines changed: 3084 additions & 1 deletion

File tree

env-example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
APPLICATION=../
99

1010
### PHP Version ########################################################################################################
11-
# Select a PHP version of the Workspace and PHP-FPM containers (Does not apply to HHVM). Accepted values: 71 - 70 - 56
11+
# Select a PHP version of the Workspace and PHP-FPM containers (Does not apply to HHVM). Accepted values: 72 - 71 - 70 - 56
1212

1313
PHP_VERSION=71
1414

php-fpm/Dockerfile-72

Lines changed: 380 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,380 @@
1+
#
2+
#--------------------------------------------------------------------------
3+
# Image Setup
4+
#--------------------------------------------------------------------------
5+
#
6+
# To edit the 'php-fpm' base Image, visit its repository on Github
7+
# https://github.com/Laradock/php-fpm
8+
#
9+
# To change its version, see the available Tags on the Docker Hub:
10+
# https://hub.docker.com/r/laradock/php-fpm/tags/
11+
#
12+
# Note: Base Image name format {image-tag}-{php-version}
13+
#
14+
15+
FROM laradock/php-fpm:2.0-72
16+
17+
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
18+
19+
#
20+
#--------------------------------------------------------------------------
21+
# Mandatory Software's Installation
22+
#--------------------------------------------------------------------------
23+
#
24+
# Mandatory Software's such as ("mcrypt", "pdo_mysql", "libssl-dev", ....)
25+
# are installed on the base image 'laradock/php-fpm' image. If you want
26+
# to add more Software's or remove existing one, you need to edit the
27+
# base image (https://github.com/Laradock/php-fpm).
28+
#
29+
30+
#
31+
#--------------------------------------------------------------------------
32+
# Optional Software's Installation
33+
#--------------------------------------------------------------------------
34+
#
35+
# Optional Software's will only be installed if you set them to `true`
36+
# in the `docker-compose.yml` before the build.
37+
# Example:
38+
# - INSTALL_ZIP_ARCHIVE=true
39+
#
40+
41+
#####################################
42+
# SOAP:
43+
#####################################
44+
45+
ARG INSTALL_SOAP=false
46+
RUN if [ ${INSTALL_SOAP} = true ]; then \
47+
# Install the soap extension
48+
apt-get update -yqq && \
49+
apt-get -y install libxml2-dev php-soap && \
50+
docker-php-ext-install soap \
51+
;fi
52+
53+
#####################################
54+
# pgsql
55+
#####################################
56+
57+
ARG INSTALL_PGSQL=false
58+
RUN if [ ${INSTALL_PGSQL} = true ]; then \
59+
# Install the pgsql extension
60+
apt-get update -yqq && \
61+
docker-php-ext-install pgsql \
62+
;fi
63+
64+
#####################################
65+
# pgsql client
66+
#####################################
67+
68+
ARG INSTALL_PG_CLIENT=false
69+
RUN if [ ${INSTALL_PG_CLIENT} = true ]; then \
70+
# Install the pgsql client
71+
apt-get update -yqq && \
72+
apt-get install -y postgresql-client \
73+
;fi
74+
75+
#####################################
76+
# xDebug:
77+
#####################################
78+
79+
ARG INSTALL_XDEBUG=false
80+
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
81+
# Install the xdebug extension
82+
pecl install xdebug && \
83+
docker-php-ext-enable xdebug \
84+
;fi
85+
86+
# Copy xdebug configuration for remote debugging
87+
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
88+
89+
#####################################
90+
# Blackfire:
91+
#####################################
92+
93+
ARG INSTALL_BLACKFIRE=false
94+
RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \
95+
version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \
96+
&& curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \
97+
&& tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \
98+
&& mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \
99+
&& printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \
100+
;fi
101+
102+
#####################################
103+
# PHP REDIS EXTENSION FOR PHP 7.0
104+
#####################################
105+
106+
ARG INSTALL_PHPREDIS=false
107+
RUN if [ ${INSTALL_PHPREDIS} = true ]; then \
108+
# Install Php Redis Extension
109+
printf "\n" | pecl install -o -f redis \
110+
&& rm -rf /tmp/pear \
111+
&& docker-php-ext-enable redis \
112+
;fi
113+
114+
#####################################
115+
# Swoole EXTENSION FOR PHP 7
116+
#####################################
117+
118+
ARG INSTALL_SWOOLE=false
119+
RUN if [ ${INSTALL_SWOOLE} = true ]; then \
120+
# Install Php Swoole Extension
121+
pecl install swoole \
122+
&& docker-php-ext-enable swoole \
123+
;fi
124+
125+
#####################################
126+
# MongoDB:
127+
#####################################
128+
129+
ARG INSTALL_MONGO=false
130+
RUN if [ ${INSTALL_MONGO} = true ]; then \
131+
# Install the mongodb extension
132+
pecl install mongodb && \
133+
docker-php-ext-enable mongodb \
134+
;fi
135+
136+
#####################################
137+
# AMQP:
138+
#####################################
139+
140+
ARG INSTALL_AMQP=false
141+
RUN if [ ${INSTALL_AMQP} = true ]; then \
142+
apt-get update && \
143+
apt-get install librabbitmq-dev -y && \
144+
# Install the amqp extension
145+
pecl install amqp && \
146+
docker-php-ext-enable amqp \
147+
;fi
148+
149+
#####################################
150+
# ZipArchive:
151+
#####################################
152+
153+
ARG INSTALL_ZIP_ARCHIVE=false
154+
RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
155+
# Install the zip extension
156+
docker-php-ext-install zip \
157+
;fi
158+
159+
#####################################
160+
# bcmath:
161+
#####################################
162+
163+
ARG INSTALL_BCMATH=false
164+
RUN if [ ${INSTALL_BCMATH} = true ]; then \
165+
# Install the bcmath extension
166+
docker-php-ext-install bcmath \
167+
;fi
168+
169+
#####################################
170+
# GMP (GNU Multiple Precision):
171+
#####################################
172+
173+
ARG INSTALL_GMP=false
174+
RUN if [ ${INSTALL_GMP} = true ]; then \
175+
# Install the GMP extension
176+
apt-get update -yqq && \
177+
apt-get install -y libgmp-dev && \
178+
docker-php-ext-install gmp \
179+
;fi
180+
181+
#####################################
182+
# PHP Memcached:
183+
#####################################
184+
185+
ARG INSTALL_MEMCACHED=false
186+
RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
187+
# Install the php memcached extension
188+
curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \
189+
&& mkdir -p memcached \
190+
&& tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
191+
&& ( \
192+
cd memcached \
193+
&& phpize \
194+
&& ./configure \
195+
&& make -j$(nproc) \
196+
&& make install \
197+
) \
198+
&& rm -r memcached \
199+
&& rm /tmp/memcached.tar.gz \
200+
&& docker-php-ext-enable memcached \
201+
;fi
202+
203+
#####################################
204+
# Exif:
205+
#####################################
206+
207+
ARG INSTALL_EXIF=false
208+
RUN if [ ${INSTALL_EXIF} = true ]; then \
209+
# Enable Exif PHP extentions requirements
210+
docker-php-ext-install exif \
211+
;fi
212+
213+
#####################################
214+
# PHP Aerospike:
215+
#####################################
216+
217+
ARG INSTALL_AEROSPIKE=false
218+
ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE}
219+
220+
# Copy aerospike configration for remote debugging
221+
COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini
222+
223+
RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \
224+
# Fix dependencies for PHPUnit within aerospike extension
225+
apt-get update -yqq && \
226+
apt-get -y install sudo wget && \
227+
228+
# Install the php aerospike extension
229+
curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php/archive/master.tar.gz" \
230+
&& mkdir -p aerospike-client-php \
231+
&& tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
232+
&& ( \
233+
cd aerospike-client-php/src \
234+
&& phpize \
235+
&& ./build.sh \
236+
&& make install \
237+
) \
238+
&& rm /tmp/aerospike-client-php.tar.gz \
239+
;fi
240+
241+
RUN if [ ${INSTALL_AEROSPIKE} = false ]; then \
242+
rm /usr/local/etc/php/conf.d/aerospike.ini \
243+
;fi
244+
245+
#####################################
246+
# Opcache:
247+
#####################################
248+
249+
ARG INSTALL_OPCACHE=false
250+
RUN if [ ${INSTALL_OPCACHE} = true ]; then \
251+
docker-php-ext-install opcache \
252+
;fi
253+
254+
# Copy opcache configration
255+
COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
256+
257+
#####################################
258+
# Mysqli Modifications:
259+
#####################################
260+
261+
ARG INSTALL_MYSQLI=false
262+
RUN if [ ${INSTALL_MYSQLI} = true ]; then \
263+
docker-php-ext-install mysqli \
264+
;fi
265+
266+
#####################################
267+
# Tokenizer Modifications:
268+
#####################################
269+
270+
ARG INSTALL_TOKENIZER=false
271+
RUN if [ ${INSTALL_TOKENIZER} = true ]; then \
272+
docker-php-ext-install tokenizer \
273+
;fi
274+
275+
#####################################
276+
# Human Language and Character Encoding Support:
277+
#####################################
278+
279+
ARG INSTALL_INTL=false
280+
RUN if [ ${INSTALL_INTL} = true ]; then \
281+
# Install intl and requirements
282+
apt-get update -yqq && \
283+
apt-get install -y zlib1g-dev libicu-dev g++ && \
284+
docker-php-ext-configure intl && \
285+
docker-php-ext-install intl \
286+
;fi
287+
288+
#####################################
289+
# GHOSTSCRIPT:
290+
#####################################
291+
292+
ARG INSTALL_GHOSTSCRIPT=false
293+
RUN if [ ${INSTALL_GHOSTSCRIPT} = true ]; then \
294+
# Install the ghostscript extension
295+
# for PDF editing
296+
apt-get update -yqq \
297+
&& apt-get install -y \
298+
poppler-utils \
299+
ghostscript \
300+
;fi
301+
302+
#####################################
303+
# LDAP:
304+
#####################################
305+
306+
ARG INSTALL_LDAP=false
307+
RUN if [ ${INSTALL_LDAP} = true ]; then \
308+
apt-get update -yqq && \
309+
apt-get install -y libldap2-dev && \
310+
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
311+
docker-php-ext-install ldap \
312+
;fi
313+
314+
#####################################
315+
# SQL SERVER:
316+
#####################################
317+
318+
ARG INSTALL_MSSQL=false
319+
ENV INSTALL_MSSQL ${INSTALL_MSSQL}
320+
RUN if [ ${INSTALL_MSSQL} = true ]; then \
321+
#####################################
322+
# Ref from https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-adding-pdo_sqlsrv-and-sqlsrv-to-official-php-image
323+
#####################################
324+
# Add Microsoft repo for Microsoft ODBC Driver 13 for Linux
325+
apt-get update -yqq && apt-get install -y apt-transport-https \
326+
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
327+
&& curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \
328+
&& apt-get update -yqq \
329+
330+
# Install Dependencies
331+
&& ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql locales \
332+
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen \
333+
334+
# Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version.
335+
&& pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \
336+
&& docker-php-ext-enable pdo_sqlsrv sqlsrv \
337+
;fi
338+
339+
#####################################
340+
# Image optimizers:
341+
#####################################
342+
USER root
343+
ARG INSTALL_IMAGE_OPTIMIZERS=false
344+
ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS}
345+
RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \
346+
apt-get update -yqq && \
347+
apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle \
348+
;fi
349+
350+
#####################################
351+
# ImageMagick:
352+
#####################################
353+
USER root
354+
ARG INSTALL_IMAGEMAGICK=false
355+
ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK}
356+
RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \
357+
apt-get update -y && \
358+
apt-get install -y libmagickwand-dev imagemagick && \
359+
pecl install imagick && \
360+
docker-php-ext-enable imagick \
361+
;fi
362+
363+
#
364+
#--------------------------------------------------------------------------
365+
# Final Touch
366+
#--------------------------------------------------------------------------
367+
#
368+
369+
ADD ./laravel.ini /usr/local/etc/php/conf.d
370+
ADD ./xlaravel.pool.conf /usr/local/etc/php-fpm.d/
371+
372+
#RUN rm -r /var/lib/apt/lists/*
373+
374+
RUN usermod -u 1000 www-data
375+
376+
WORKDIR /var/www
377+
378+
CMD ["php-fpm"]
379+
380+
EXPOSE 9000

0 commit comments

Comments
 (0)