Commit 02739a97 authored by Fabio Montefuscolo's avatar Fabio Montefuscolo

Merge branch 'php'

parents 26966c53 634b340a
......@@ -6,12 +6,16 @@ RUN a2enmod rewrite expires ssl
# Install the PHP extensions we need
RUN apt-get update && apt-get install -y libpng12-dev libjpeg-dev libmemcached-dev && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mysqli opcache zip
&& docker-php-ext-install gd mysqli opcache zip mbstring
# Support memcache
RUN printf "yes\n" | pecl install memcache \
&& echo 'extension=memcache.so' > /usr/local/etc/php/conf.d/pecl-memcache.ini
# Support memcached
RUN printf "yes\n" | pecl install memcached \
&& echo 'extension=memcached.so' > /usr/local/etc/php/conf.d/pecl-memcached.ini
# Composer facility
RUN curl -s -o installer.php https://getcomposer.org/installer \
&& php installer.php --install-dir=/usr/local/bin/ --filename=composer \
......
#!/bin/bash
if [ "$OPCACHE" = "false" ];
then
echo "php_flag opcache.enable Off" >> /var/www/html/.htaccess
fi
#
# Should I respect the owner of mounted volumes
#
volume=$(mount -l | awk '/var\/www\/html/{ print $3; exit; }')
if [ -n "$volume" ];
then
uid=$(stat -c %u "$volume")
gid=$(stat -c %g "$volume")
fi
if [ -n "$uid" ];
then
user=$(awk -F: "/:$uid:[0-9]+:/{ print \$1}" /etc/passwd)
group=$(awk -F: "/:x:$gid:/{ print \$1}" /etc/group)
if [ -z "$group" ];
then
usermod -g "$gid" www-data
fi
if [ -z "$user" ];
then
usermod -u "$uid" www-data
fi
fi
chown -R www-data:www-data /var/www/html
exec "$@"
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment