Skip to content

Commit ebe0d2a

Browse files
committed
updated support for php7.1
1 parent 9d20ac1 commit ebe0d2a

File tree

3 files changed

+62
-11
lines changed

3 files changed

+62
-11
lines changed

php7.1/cli/Dockerfile

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
FROM php:7.1-cli
22

3-
MAINTAINER ReadyMadeHost
4-
5-
ARG NODE_VERSION
6-
ENV NODE_VERSION ${NODE_VERSION}
3+
LABEL maintainer="ReadyMadeHost http://readymadehost.com"
74

85
# Installing required packages
96
RUN apt-get update && apt-get upgrade -y
@@ -36,9 +33,16 @@ RUN docker-php-ext-install \
3633
opcache \
3734
gd
3835

39-
# Installing others dependencies
36+
RUN pecl install apcu
37+
RUN docker-php-ext-enable apcu
38+
39+
# Installing other extensions but enabled dynamically
4040
RUN pecl install redis
41-
RUN docker-php-ext-enable redis
41+
# RUN docker-php-ext-enable redis
42+
RUN pecl install xdebug
43+
# RUN docker-php-ext-enable xdebug
44+
RUN pecl install mongodb
45+
# RUN docker-php-ext-enable mongodb
4246

4347
# Updating php.ini
4448
ADD conf/php.ini /usr/local/etc/php/php.ini
@@ -51,6 +55,9 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
5155
RUN wget https://get.symfony.com/cli/installer -O - | bash
5256
RUN echo 'export PATH="$HOME/.symfony/bin:$PATH"' >> ~/.bashrc
5357

58+
ARG NODE_VERSION
59+
ENV NODE_VERSION ${NODE_VERSION}
60+
5461
# Installing node
5562
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
5663
RUN apt-get -y install nodejs
@@ -61,7 +68,15 @@ ADD manage-project-permission.sh /root/manage-project-permission.sh
6168
RUN chmod +x /root/manage-project-permission.sh
6269
RUN echo 'alias mpp="/root/manage-project-permission.sh"' >> /root/.bashrc
6370
RUN /root/manage-project-permission.sh
71+
72+
ARG PHP_ENABLE_REDIS
73+
ENV PHP_ENABLE_REDIS ${PHP_ENABLE_REDIS}
74+
ARG PHP_ENABLE_XDEBUG
75+
ENV PHP_ENABLE_XDEBUG ${PHP_ENABLE_XDEBUG}
76+
ARG PHP_ENABLE_MONGODB
77+
ENV PHP_ENABLE_MONGODB ${PHP_ENABLE_MONGODB}
78+
6479
ADD docker-entrypoint.sh /root/docker-entrypoint.sh
6580
RUN chmod +x /root/docker-entrypoint.sh
6681

67-
CMD ["/root/docker-entrypoint.sh"]
82+
CMD ["/root/docker-entrypoint.sh", "bash"]

php7.1/fpm/Dockerfile

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM php:7.1-fpm
22

3-
MAINTAINER ReadyMadeHost
3+
LABEL maintainer="ReadyMadeHost http://readymadehost.com"
44

55
# Installing required packages
66
RUN apt-get update && apt-get upgrade -y
@@ -26,11 +26,29 @@ RUN docker-php-ext-install \
2626
opcache \
2727
gd
2828

29-
# Installing others dependencies
29+
RUN pecl install apcu
30+
RUN docker-php-ext-enable apcu
31+
32+
# Installing other extensions but enabled dynamically
3033
RUN pecl install redis
31-
RUN docker-php-ext-enable redis
34+
# RUN docker-php-ext-enable redis
35+
RUN pecl install xdebug
36+
# RUN docker-php-ext-enable xdebug
37+
RUN pecl install mongodb
38+
# RUN docker-php-ext-enable mongodb
3239

3340
# Updating php.ini
3441
ADD conf/php.ini /usr/local/etc/php/php.ini
3542

36-
CMD ["php-fpm", "-F"]
43+
ARG PHP_ENABLE_REDIS
44+
ENV PHP_ENABLE_REDIS ${PHP_ENABLE_REDIS}
45+
ARG PHP_ENABLE_XDEBUG
46+
ENV PHP_ENABLE_XDEBUG ${PHP_ENABLE_XDEBUG}
47+
ARG PHP_ENABLE_MONGODB
48+
ENV PHP_ENABLE_MONGODB ${PHP_ENABLE_MONGODB}
49+
50+
# Add scripts
51+
ADD docker-entrypoint.sh /root/docker-entrypoint.sh
52+
RUN chmod +x /root/docker-entrypoint.sh
53+
54+
CMD ["/root/docker-entrypoint.sh", "php-fpm", "-F"]

php7.1/fpm/docker-entrypoint.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
if [ ${PHP_ENABLE_REDIS} -eq "1" ]; then
4+
docker-php-ext-enable redis
5+
echo "-- php fpm redis extension enabled"
6+
fi
7+
8+
if [ ${PHP_ENABLE_XDEBUG} -eq "1" ]; then
9+
docker-php-ext-enable xdebug
10+
echo "-- php fpm xdebug extension enabled"
11+
fi
12+
13+
if [ ${PHP_ENABLE_MONGODB} -eq "1" ]; then
14+
docker-php-ext-enable mongodb
15+
echo "-- php fpm mongodb extension enabled"
16+
fi
17+
18+
exec "$@"

0 commit comments

Comments
 (0)