Skip to content

Commit e17dd31

Browse files
authored
Merge pull request #16 from ModestCoders/feature/add-php7.3-support
add php 7.3 image
2 parents d3cea3b + 5e205db commit e17dd31

File tree

7 files changed

+568
-4
lines changed

7 files changed

+568
-4
lines changed

php/7.3-fpm/Dockerfile

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
FROM php:7.3-fpm
2+
3+
LABEL authors="Daniel Lozano <dn.lozano.m@gmail.com>, Juan Alonso <juan.jalogut@gmail.com>"
4+
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
cron \
7+
git \
8+
gzip \
9+
libfreetype6-dev \
10+
libicu-dev \
11+
libjpeg62-turbo-dev \
12+
libmcrypt-dev \
13+
libpng-dev \
14+
libxslt1-dev \
15+
libzip-dev \
16+
lsof \
17+
mariadb-client \
18+
vim \
19+
zip \
20+
procps \
21+
sudo \
22+
openssh-client \
23+
&& rm -rf /var/lib/apt/lists/*
24+
25+
RUN docker-php-ext-configure \
26+
gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
27+
28+
RUN docker-php-ext-install \
29+
bcmath \
30+
gd \
31+
intl \
32+
mbstring \
33+
opcache \
34+
pcntl \
35+
pdo_mysql \
36+
soap \
37+
xsl \
38+
zip \
39+
sockets
40+
41+
# Remove libsodium and install upgrading version:
42+
RUN rm -f /usr/local/etc/php/conf.d/*sodium.ini \
43+
&& rm -f /usr/local/lib/php/extensions/*/*sodium.so \
44+
&& apt-get remove libsodium* -y \
45+
&& mkdir -p /tmp/libsodium \
46+
&& curl -sL https://github.com/jedisct1/libsodium/archive/1.0.18-RELEASE.tar.gz | tar xzf - -C /tmp/libsodium \
47+
&& cd /tmp/libsodium/libsodium-1.0.18-RELEASE/ \
48+
&& ./configure \
49+
&& make && make check \
50+
&& make install \
51+
&& cd / \
52+
&& rm -rf /tmp/libsodium \
53+
&& pecl install -o -f libsodium \
54+
&& docker-php-ext-enable sodium
55+
56+
RUN pecl channel-update pecl.php.net \
57+
&& pecl install xdebug \
58+
&& docker-php-ext-enable xdebug \
59+
&& sed -i -e 's/^zend_extension/\;zend_extension/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
60+
61+
# install composer
62+
RUN EXPECTED_SIGNATURE="$(curl -s https://composer.github.io/installer.sig)" \
63+
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
64+
&& ACTUAL_SIGNATURE="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" \
65+
&& ( if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then >&2 echo 'ERROR: Invalid installer signature'; rm composer-setup.php; exit 1; fi ) \
66+
&& php composer-setup.php --install-dir /usr/local/bin --filename=composer \
67+
&& php -r "unlink('composer-setup.php');"
68+
69+
RUN groupadd -g 1000 app \
70+
&& useradd -g 1000 -u 1000 -d /var/www -s /bin/bash app
71+
72+
COPY conf/www.conf /usr/local/etc/php-fpm.d/
73+
COPY conf/php.ini /usr/local/etc/php/
74+
COPY conf/xdebug.ini /usr/local/etc/php/conf.d/
75+
COPY conf/php-fpm.conf /usr/local/etc/
76+
77+
RUN mkdir /sock
78+
RUN chown -R app:app /usr/local/etc/php/conf.d /sock
79+
80+
RUN mkdir -p /var/www && chown -R app:app /var/www/
81+
RUN echo "app ALL=(ALL) NOPASSWD: /bin/chown" >> /etc/sudoers.d/app
82+
83+
USER app:app
84+
85+
VOLUME /var/www
86+
87+
WORKDIR /var/www/html
88+
89+
EXPOSE 9001
90+
91+
COPY ./docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
92+
93+
ENTRYPOINT [ "docker-entrypoint.sh" ]
94+
CMD [ "php-fpm" ]

php/7.3-fpm/conf/php-fpm.conf

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
; This file was initially adapated from the output of: (on PHP 5.6)
2+
; grep -vE '^;|^ *$' /usr/local/etc/php-fpm.conf.default
3+
4+
[global]
5+
6+
error_log = /proc/self/fd/2
7+
daemonize = no
8+
9+
[www]
10+
11+
; if we send this to /proc/self/fd/1, it never appears
12+
access.log = /proc/self/fd/2
13+
14+
;user = app
15+
;group = app
16+
17+
listen = /sock/docker.sock
18+
listen.owner = app
19+
listen.group = app
20+
listen.mode = 0660
21+
22+
pm = dynamic
23+
pm.max_children = 10
24+
pm.start_servers = 4
25+
pm.min_spare_servers = 2
26+
pm.max_spare_servers = 6
27+
28+
clear_env = no
29+
30+
; Ensure worker stdout and stderr are sent to the main error log.
31+
catch_workers_output = yes

php/7.3-fpm/conf/php.ini

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
memory_limit = 2G
2+
max_execution_time = 1800
3+
zlib.output_compression = On
4+
cgi.fix_pathinfo = 0
5+
date.timezone = UTC
6+
7+
upload_max_filesize = 20M
8+
post_max_size = 20M

0 commit comments

Comments
 (0)