Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memcached warning for php 5.6 #74

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions php/5.6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
FROM php:5.6-fpm

LABEL maintainer="Abhijit Rakas <[email protected]>"
LABEL org.label-schema.schema-version="1.0.0-rc1"
LABEL org.label-schema.vendor="EasyEngine"
LABEL org.label-schema.name="php5.6"

RUN set -ex; \
apt-get update; \
apt-get install -y --no-install-recommends \
imagemagick \
less \
libc-client-dev \
libfreetype6-dev \
libjpeg-dev \
libjpeg62-turbo-dev \
libkrb5-dev \
libmagickwand-dev \
libmcrypt-dev \
libmemcached-dev \
libxml2-dev \
libpng-dev \
libzip-dev \
mysql-client \
ssmtp \
unzip \
vim \
zip

RUN pecl install imagick memcached-2.2.0; \
printf "\n" | pecl install mcrypt-1.0.1; \
printf "\n" | pecl install redis; \
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
docker-php-ext-configure zip --with-libzip; \
docker-php-ext-configure --with-php-config=/usr/local/bin/php-config; \
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
docker-php-ext-install gd imap mysqli opcache soap zip; \
docker-php-ext-enable imagick mcrypt redis; \
echo "extension=memcached.so" >> /usr/local/etc/php/conf.d/memcached.ini; \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*;

RUN mkdir -p /usr/src/php/ext; \
cd /usr/src/php/ext/; \
curl -sSL -o php7.zip https://github.com/websupport-sk/pecl-memcache/archive/NON_BLOCKING_IO_php7.zip; \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the correct version of memcache that we're using? The URL itself contains php7

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbtamuli URL contains php7 because of branch name. No official words in readme about php5.6 support but repo contains code for both PHP version 5 and 7 though need to test once.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sagarnasit Did you get a chance to test this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sagarnasit Please add yourself also as maintainer.

unzip php7.zip; \
mv pecl-memcache-NON_BLOCKING_IO_php7 memcache; \
rm -rf /tmp/pecl-memcache-php7 /usr/src/php/ext/php7.zip; \
docker-php-ext-configure memcache --with-php-config=/usr/local/bin/php-config; \
docker-php-ext-install memcache;

# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

# Donwload and install composer
RUN curl -sSL "https://getcomposer.org/installer" | php \
&& mv composer.phar /usr/local/bin/composer

# Install wp-cli
RUN curl -O "https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar" \
&& chmod +x wp-cli.phar \
&& mv wp-cli.phar /usr/local/bin/wp

# Setup a config file
RUN mkdir -p /etc/wp-cli
RUN { \
echo 'path: /var/www/htdocs'; \
} > /etc/wp-cli/config.yml

RUN echo "mailhub=postfix\nUseTLS=NO\nFromLineOverride=YES" > /etc/ssmtp/ssmtp.conf

# Setup logs
RUN mkdir -p /var/log/php; \
chown -R www-data: /var/log/php; \
rm /usr/local/etc/php-fpm.d/*; \
mv /usr/local/etc/php/php.ini-production /usr/local/etc/php/php.ini
COPY easyengine.conf /usr/local/etc/php-fpm.d/easyengine.conf

COPY expose_off.ini /usr/local/etc/php/conf.d/expose_off.ini
COPY bashrc /root/.bashrc
COPY bashrc /var/www/.bashrc
COPY docker-entrypoint.sh /usr/local/bin/

WORKDIR /var/www/htdocs
USER www-data

ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["php-fpm"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion php/Dockerfile → php/7.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ RUN set -ex; \
RUN pecl install imagick memcached; \
printf "\n" | pecl install mcrypt-1.0.1; \
printf "\n" | pecl install redis; \
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
docker-php-ext-configure gd --enable-gd-native-ttf --with-freetype-dir=/usr/include/freetype2 --with-png-dir=/usr/include --with-jpeg-dir=/usr/include \
docker-php-ext-configure zip --with-libzip; \
docker-php-ext-configure --with-php-config=/usr/local/bin/php-config; \
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
Expand Down
2 changes: 2 additions & 0 deletions php/7.2/bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
PS1="\`if [ \$? = 0 ]; then echo \[\e[37m\]^_^[\u@$VIRTUAL_HOST:\w]\\$ \[\e[0m\]; else echo \[\e[31m\]O_O[\u@$VIRTUAL_HOST:\w]\\$ \[\e[0m\]; fi\`"
export HISTTIMEFORMAT="%d/%m/%y %T "
4 changes: 4 additions & 0 deletions php/7.2/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -euo pipefail

exec "$@"
20 changes: 20 additions & 0 deletions php/7.2/easyengine.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[global]
error_log = /var/log/php/error.log
daemonize = no

[www]
ping.path = /ee-admin/ping
pm.status_path = /ee-admin/status
request_terminate_timeout = 300
user = www-data
group = www-data
pm = ondemand
pm.max_children = 20
listen = 9000
; if we send this to /proc/self/fd/1, it never appears
access.log = /var/log/php/access.log

clear_env = no

; Ensure worker stdout and stderr are sent to the main error log.
catch_workers_output = yes
1 change: 1 addition & 0 deletions php/7.2/expose_off.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
expose_php = Off