-
Notifications
You must be signed in to change notification settings - Fork 19
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
base: develop
Are you sure you want to change the base?
Changes from 1 commit
bf316b3
1fcab24
4ef8963
295ea01
88168fa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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="php" | ||
|
||
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; \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mbtamuli URL contains There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sagarnasit Did you get a chance to test this? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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"] |
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 " |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
exec "$@" |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
expose_php = Off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need another label to differentiate between the PHP7 and PHP5.6 containers. We can use
org.label-schema.version
as mentioned here - http://label-schema.org/rc1/There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abhijitrakas Similarly for PHP7 image also, we need to add the label.