Created
May 16, 2019 17:51
-
-
Save Biker93/0aebac1ceba5d516348c6bc01fb332ca to your computer and use it in GitHub Desktop.
Biker Drupal 7 Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# docker build -t drupal:d7adp72 -f d7adp72.Dockerfile . | |
# docker image tag drupal:d7adp72 .../drupal:d7adp72 | |
# docker push .../drupal:d7adp72 | |
FROM php:7.2-apache | |
# install the PHP extensions we need | |
RUN set -ex; \ | |
\ | |
if command -v a2enmod; then \ | |
a2enmod rewrite; \ | |
fi; \ | |
\ | |
apt-get update; \ | |
apt-get install -y \ | |
zlib1g-dev \ | |
curl \ | |
wget \ | |
vim \ | |
git \ | |
unzip \ | |
mysql-client \ | |
libjpeg-dev \ | |
libpng-dev \ | |
libpq-dev \ | |
; \ | |
\ | |
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \ | |
docker-php-ext-install -j "$(nproc)" \ | |
gd \ | |
json \ | |
mbstring \ | |
opcache \ | |
pdo_mysql \ | |
zip \ | |
; | |
RUN yes | pecl install xdebug \ | |
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ | |
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \ | |
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini \ | |
&& echo "xdebug.profiler_enable_trigger=on" >> /usr/local/etc/php/conf.d/xdebug.ini | |
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer; \ | |
composer global require drush/drush:dev-master; \ | |
composer global update; \ | |
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"' >> ~/.bashrc | |
# set recommended PHP.ini settings | |
# see https://secure.php.net/manual/en/opcache.installation.php | |
RUN { \ | |
# Zend OPcache | |
echo "opcache.enable=1"; \ | |
echo 'opcache.enable_cli=1'; \ | |
echo 'opcache.fast_shutdown=1'; \ | |
echo 'opcache.interned_strings_buffer=16'; \ | |
echo 'opcache.max_accelerated_files=4000'; \ | |
echo 'opcache.memory_consumption=256'; \ | |
echo 'opcache.revalidate_freq=0'; \ | |
} > /usr/local/etc/php/conf.d/opcache-recommended.ini | |
RUN { \ | |
# Core | |
echo "disable_functions = mail"; \ | |
echo "memory_limit = 256M"; \ | |
# Date | |
echo "date.timezone = america/new_york"; \ | |
} > /usr/local/etc/php/php.ini | |
WORKDIR /var/www/html | |
# https://www.drupal.org/node/3060/release | |
ENV DRUPAL_VERSION 7.60 | |
ENV DRUPAL_MD5 ba14bf3ddc8e182adb49eb50ae117f3e | |
# ENV DRUPAL_VERSION 8.6.3 | |
# ENV DRUPAL_MD5 3a3b8e4326b493ed6c29188db40031ff | |
RUN curl -fSL "https://ftp.drupal.org/files/projects/drupal-${DRUPAL_VERSION}.tar.gz" -o drupal.tar.gz \ | |
&& echo "${DRUPAL_MD5} *drupal.tar.gz" | md5sum -c - \ | |
&& tar -xz --strip-components=1 -f drupal.tar.gz \ | |
&& rm drupal.tar.gz \ | |
&& chown -R www-data:www-data sites modules themes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment