Skip to content

Commit eabe7ce

Browse files
committed
updated support for php7.3
1 parent 891a1d7 commit eabe7ce

File tree

4 files changed

+77
-8
lines changed

4 files changed

+77
-8
lines changed

php7.3/cli/Dockerfile

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

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

55
ARG NODE_VERSION
66
ENV NODE_VERSION ${NODE_VERSION}
@@ -36,9 +36,16 @@ RUN docker-php-ext-install \
3636
opcache \
3737
gd
3838

39-
# Installing others dependencies
39+
RUN pecl install apcu
40+
RUN docker-php-ext-enable apcu
41+
42+
# Installing other extensions but enabled dynamically
4043
RUN pecl install redis
41-
RUN docker-php-ext-enable redis
44+
# RUN docker-php-ext-enable redis
45+
RUN pecl install xdebug
46+
# RUN docker-php-ext-enable xdebug
47+
RUN pecl install mongodb
48+
# RUN docker-php-ext-enable mongodb
4249

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

61+
ARG NODE_VERSION
62+
ENV NODE_VERSION ${NODE_VERSION}
63+
5464
# Installing node
5565
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
5666
RUN apt-get -y install nodejs
@@ -61,7 +71,15 @@ ADD manage-project-permission.sh /root/manage-project-permission.sh
6171
RUN chmod +x /root/manage-project-permission.sh
6272
RUN echo 'alias mpp="/root/manage-project-permission.sh"' >> /root/.bashrc
6373
RUN /root/manage-project-permission.sh
74+
75+
ARG PHP_ENABLE_REDIS
76+
ENV PHP_ENABLE_REDIS ${PHP_ENABLE_REDIS}
77+
ARG PHP_ENABLE_XDEBUG
78+
ENV PHP_ENABLE_XDEBUG ${PHP_ENABLE_XDEBUG}
79+
ARG PHP_ENABLE_MONGODB
80+
ENV PHP_ENABLE_MONGODB ${PHP_ENABLE_MONGODB}
81+
6482
ADD docker-entrypoint.sh /root/docker-entrypoint.sh
6583
RUN chmod +x /root/docker-entrypoint.sh
6684

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

php7.3/cli/docker-entrypoint.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,19 @@
22

33
/root/manage-project-permission.sh
44

5+
if [ ${PHP_ENABLE_REDIS} -eq "1" ]; then
6+
docker-php-ext-enable redis
7+
echo "-- php cli redis extension enabled"
8+
fi
9+
10+
if [ ${PHP_ENABLE_XDEBUG} -eq "1" ]; then
11+
docker-php-ext-enable xdebug
12+
echo "-- php cli xdebug extension enabled"
13+
fi
14+
15+
if [ ${PHP_ENABLE_MONGODB} -eq "1" ]; then
16+
docker-php-ext-enable mongodb
17+
echo "-- php cli mongodb extension enabled"
18+
fi
19+
520
tail -f /dev/null

php7.3/fpm/Dockerfile

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM php:7.3-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.3/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)