Skip to content

Commit 67f92de

Browse files
committed
Refactor the PHP 5 Dockerfile
1 parent c8d4461 commit 67f92de

2 files changed

Lines changed: 46 additions & 23 deletions

File tree

php-fpm/Dockerfile-5

Lines changed: 44 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,69 @@
1+
#
2+
#--------------------------------------------------------------------------
3+
# Image Setup
4+
#--------------------------------------------------------------------------
5+
#
6+
17
FROM php:5.6-fpm
28

39
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
410

511
ADD ./laravel.ini /usr/local/etc/php/conf.d
612
ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/
713

8-
RUN apt-get update && apt-get install -y \
9-
libpq-dev \
10-
libmemcached-dev \
14+
RUN apt-get update
15+
16+
#
17+
#--------------------------------------------------------------------------
18+
# Software's Installation
19+
#--------------------------------------------------------------------------
20+
#
21+
# Installing tools and PHP extentions using "apt", "docker-php", "pecl",
22+
#
23+
24+
# Install "curl", "libmemcached-dev", "libpq-dev", "libjpeg-dev",
25+
# "libpng12-dev", "libfreetype6-dev", "libssl-dev", "libmcrypt-dev",
26+
RUN apt-get install -y --no-install-recommends \
1127
curl \
28+
libmemcached-dev \
29+
libpq-dev \
1230
libjpeg-dev \
1331
libpng12-dev \
1432
libfreetype6-dev \
1533
libssl-dev \
16-
libmcrypt-dev \
17-
--no-install-recommends \
18-
&& rm -r /var/lib/apt/lists/*
34+
libmcrypt-dev
1935

20-
# install mcrypt library
36+
# Install the PHP mcrypt extention
2137
RUN docker-php-ext-install mcrypt
2238

23-
# Install mongodb driver
24-
RUN pecl install mongodb
39+
# Install the PHP pdo_mysql extention
40+
RUN docker-php-ext-install pdo_mysql
2541

26-
# configure gd library
27-
RUN docker-php-ext-configure gd \
28-
--enable-gd-native-ttf \
29-
--with-jpeg-dir=/usr/lib \
30-
--with-freetype-dir=/usr/include/freetype2
42+
# Install the PHP pdo_pgsql extention
43+
RUN docker-php-ext-install pdo_pgsql
3144

32-
# Install extensions using the helper script provided by the base image
33-
RUN docker-php-ext-install \
34-
pdo_mysql \
35-
pdo_pgsql \
36-
gd
45+
# Install the PHP gd library
46+
RUN docker-php-ext-install gd \
47+
&& docker-php-ext-configure gd \
48+
--enable-gd-native-ttf \
49+
--with-jpeg-dir=/usr/lib \
50+
--with-freetype-dir=/usr/include/freetype2
3751

38-
# Install memcached
39-
RUN pecl install memcached \
40-
&& docker-php-ext-enable memcached
52+
# Install the mongodb extention
53+
RUN pecl install mongodb
4154

42-
# Install xdebug
55+
# Install the xdebug extention
4356
RUN pecl install xdebug \
4457
&& docker-php-ext-enable xdebug
4558

59+
#
60+
#--------------------------------------------------------------------------
61+
# Final Touch
62+
#--------------------------------------------------------------------------
63+
#
64+
65+
RUN rm -r /var/lib/apt/lists/*
66+
4667
RUN usermod -u 1000 www-data
4768

4869
WORKDIR /var/www/laravel

php-fpm/Dockerfile-70

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
FROM php:7.0-fpm
88

9+
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
10+
911
ADD ./laravel.ini /usr/local/etc/php/conf.d
1012
ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/
1113

0 commit comments

Comments
 (0)