Skip to content

Commit d263d58

Browse files
committed
Added php5.6 alpine
1 parent 01e3389 commit d263d58

File tree

16 files changed

+147
-1
lines changed

16 files changed

+147
-1
lines changed

php5.6-fpm/alpine/Dockerfile

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
FROM php:5.6-fpm-alpine
2+
LABEL maintainer="ITK Dev <[email protected]>"
3+
4+
ENV PHP_OPCACHE_VALIDATE_TIMESTAMPS="1" \
5+
PHP_OPCACHE_MAX_ACCELERATED_FILES="20000" \
6+
PHP_OPCACHE_MEMORY_CONSUMPTION="64" \
7+
PHP_OPCACHE_MAX_WASTED_PERCENTAGE="10" \
8+
PHP_APCU_MEMORY_SIZE="16M" \
9+
PHP_MAX_EXECUTION_TIME="30" \
10+
PHP_MEMORY_LIMIT="128M" \
11+
PHP_POST_MAX_SIZE="8M" \
12+
PHP_UPLOAD_MAX_FILESIZE="2M" \
13+
PHP_PM_MAX_CHILDREN="40" \
14+
PHP_PM_MAX_REQUESTS="0" \
15+
PHP_PM_START_SERVERS="5" \
16+
PHP_PM_MIN_SPARE_SERVERS="5" \
17+
PHP_PM_MAX_SPARE_SERVERS="8" \
18+
PHP_REQUEST_SLOWLOG_TIMEOUT="0" \
19+
PHP_SLOWLOG="/var/log/php-slow.log" \
20+
PHP_XDEBUG=0 \
21+
PHP_XDEBUG_MAX_NESTING_LEVEL=265 \
22+
PHP_XDEBUG_REMOTE_ADDR_HEADER="" \
23+
PHP_XDEBUG_REMOTE_AUTOSTART=0 \
24+
PHP_XDEBUG_REMOTE_CONNECT_BACK=1 \
25+
PHP_XDEBUG_REMOTE_ENABLE=1 \
26+
PHP_XDEBUG_REMOTE_HANDLER="dbgp" \
27+
PHP_XDEBUG_REMOTE_HOST="localhost" \
28+
PHP_XDEBUG_REMOTE_LOG="" \
29+
PHP_XDEBUG_REMOTE_MODE="req" \
30+
PHP_XDEBUG_REMOTE_PORT="9000"
31+
32+
RUN apk --update add --no-cache \
33+
libxslt-dev \
34+
libzip-dev \
35+
libpng-dev \
36+
gettext-dev \
37+
git \
38+
unzip \
39+
icu-dev \
40+
openldap-dev \
41+
libmcrypt-dev \
42+
&& docker-php-ext-install -j$(nproc) \
43+
bcmath \
44+
gd \
45+
gettext \
46+
intl \
47+
ldap \
48+
mcrypt \
49+
mysql \
50+
mysqli \
51+
opcache \
52+
pdo_mysql \
53+
sysvsem \
54+
xsl \
55+
zip
56+
57+
RUN apk --update add --no-cache --virtual .build-deps autoconf g++ make \
58+
&& pecl install redis-4.0.1 \
59+
&& docker-php-ext-enable redis \
60+
&& apk del .build-deps
61+
62+
# Added cache tool.
63+
ADD https://gordalina.github.io/cachetool/downloads/cachetool.phar /usr/local/bin/cachetool
64+
RUN chmod +x /usr/local/bin/cachetool
65+
66+
# Use default PHP production configuration.
67+
RUN mv ${PHP_INI_DIR}/php.ini-production ${PHP_INI_DIR}/php.ini
68+
69+
# Copy custom PHP configuration.
70+
COPY etc/php/conf.d/opcache.ini /usr/local/etc/php/conf.d/20-opcache.ini
71+
COPY etc/php/conf.d/xdebug.ini /usr/local/etc/php/conf.d/30-xdebug.ini
72+
COPY etc/php/conf.d/php.ini /usr/local/etc/php/conf.d/20-php.ini
73+
74+
# Custom FPM configuration.
75+
COPY etc/php-fpm.d/fpm.ini /usr/local/etc/php-fpm.d/zz-fpm-docker.conf
76+
77+
EXPOSE 9000
78+
79+
WORKDIR /app
80+
81+
COPY docker-entrypoint.sh /usr/local/bin/
82+
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
83+
84+
CMD [ "docker-entrypoint.sh" ]
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# Add docker host domain to hosts file
5+
if [ ! -z "${DOCKER_HOST_DOMAIN}" ]; then
6+
echo $(getent hosts host.docker.internal | cut -d" " -f1) ${DOCKER_HOST_DOMAIN} >> /etc/hosts
7+
fi
8+
9+
# Set xdebug remote host to docker host ip.
10+
export PHP_XDEBUG_REMOTE_HOST=$(getent hosts host.docker.internal | cut -d" " -f1)
11+
12+
## Start the php FPM process.
13+
echo "Starting PHP 5.6 FPM"
14+
/usr/local/bin/docker-php-entrypoint php-fpm
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[www]
2+
pm = dynamic
3+
pm.max_children = ${PHP_PM_MAX_CHILDREN}
4+
pm.start_servers = ${PHP_PM_START_SERVERS}
5+
pm.min_spare_servers = ${PHP_PM_MIN_SPARE_SERVERS}
6+
pm.max_spare_servers = ${PHP_PM_MAX_SPARE_SERVERS}
7+
pm.max_requests = ${PHP_PM_MAX_REQUESTS}
8+
9+
request_slowlog_timeout = ${PHP_REQUEST_SLOWLOG_TIMEOUT}
10+
slowlog = ${PHP_SLOWLOG}
11+
12+
; Enable the FPM status page
13+
pm.status_path = /status
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[opcache]
2+
opcache.enable=1
3+
opcache.revalidate_freq=0
4+
opcache.validate_timestamps=${PHP_OPCACHE_VALIDATE_TIMESTAMPS}
5+
opcache.max_accelerated_files=${PHP_OPCACHE_MAX_ACCELERATED_FILES}
6+
opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}
7+
opcache.max_wasted_percentage=${PHP_OPCACHE_MAX_WASTED_PERCENTAGE}
8+
opcache.interned_strings_buffer=16
9+
opcache.fast_shutdown=1
10+
11+
# See https://github.com/symfony/symfony/pull/29349
12+
opcache.optimization_level=0xFFFFFFEF
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Real path configuration
2+
realpath_cache_size = 4096k
3+
realpath_cache_ttl = 600
4+
5+
expose_php = Off
6+
max_execution_time = ${PHP_MAX_EXECUTION_TIME}
7+
memory_limit = ${PHP_MEMORY_LIMIT}
8+
9+
post_max_size = ${PHP_POST_MAX_SIZE}
10+
upload_max_filesize = ${PHP_UPLOAD_MAX_FILESIZE}
11+
12+
date.timezone = UTC
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
zend_extension=xdebug.so
2+
xdebug.max_nesting_level = ${PHP_XDEBUG_MAX_NESTING_LEVEL}
3+
xdebug.remote_addr_header = ${PHP_XDEBUG_REMOTE_ADDR_HEADER}
4+
xdebug.remote_autostart = ${PHP_XDEBUG_REMOTE_AUTOSTART}
5+
xdebug.remote_connect_back = ${PHP_XDEBUG_REMOTE_CONNECT_BACK}
6+
xdebug.remote_enable = ${PHP_XDEBUG_REMOTE_ENABLE}
7+
xdebug.remote_handler = ${PHP_XDEBUG_REMOTE_HANDLER}
8+
xdebug.remote_host = ${PHP_XDEBUG_REMOTE_HOST}
9+
xdebug.remote_log = ${PHP_XDEBUG_REMOTE_LOG"}
10+
xdebug.remote_mode = ${PHP_XDEBUG_REMOTE_MODE}
11+
xdebug.remote_port = ${PHP_XDEBUG_REMOTE_PORT}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM ubuntu:16.04
2-
LABEL maintainer "ITK Dev <[email protected]>"
2+
LABEL maintainer="ITK Dev <[email protected]>"
33

44
ENV PHP_VERSION 5.6
55

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)