From ce8bd0d35b8fe1c3628eff13060e49d1e5cc243d Mon Sep 17 00:00:00 2001 From: Nono95230 Date: Tue, 12 Nov 2019 16:56:45 +0100 Subject: [PATCH 1/7] Add xdebug function to bashrc. --- 5.3/config/bashrc | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/5.3/config/bashrc b/5.3/config/bashrc index e705e88..c0fd9d9 100644 --- a/5.3/config/bashrc +++ b/5.3/config/bashrc @@ -3,3 +3,49 @@ alias drush='sudo -u www-data drush' alias git='sudo -u www-data git' alias wget='sudo -u www-data wget' alias ssh='sudo -u www-data ssh' + +# For use xdebug on/off/status. +function xdebug() { + echo_error() { printf "\033[0;31m%s\n\033[0m" "$*" >&2; } + echo_in_red() { printf "\033[0;31m%s\n\033[0m" "$*" >&2; } + echo_in_green() { printf "\033[0;32m%s\n\033[0m" "$*" >&2; } + echo_in_orange() { printf "\033[0;33m%s\n\033[0m" "$*" >&2; } + echo_in_cyan() { printf "\033[0;36m%s\n\033[0m" "$*" >&2; } + xdb_usage() { + echo_in_cyan 'Using the xdebug function :'; + echo_in_cyan ''; + echo_in_cyan 'on Enables the Xdebug extension of PHP'; + echo_in_cyan 'off Disables the Xdebug extension of PHP'; + echo_in_cyan 'status Allows to know the status of the Xdebug extension of PHP'; + } + ZendExtensionXdebugSoPATH=/etc/php5/cli/conf.d/xdebug.ini + + if [ -f $ZendExtensionXdebugSoPATH ]; then + case "$1" in + on) + sudo sed -i 's/^;*\(.*xdebug\.so\)/\1/' $ZendExtensionXdebugSoPATH + sudo service apache2 reload > /dev/null + echo_in_green 'xdebug on'; + ;; + off) + sudo sed -i 's/^\(.*xdebug\.so\)/;\1/' $ZendExtensionXdebugSoPATH + sudo service apache2 reload > /dev/null + echo_in_red 'xdebug off'; + ;; + status) + XdebugConfigFirstChar=$(grep xdebug.so $ZendExtensionXdebugSoPATH | cut -c1-1) + if [[ $XdebugConfigFirstChar != ";" ]]; then + echo_in_orange 'Xdebug is enable !'; + else + echo_in_orange 'Xdebug is disable !' + fi + ;; + *) + xdb_usage + esac + else + echo_error "ERROR :" + echo_error "The file \"$ZendExtensionXdebugSoPATH\" is not found !" + echo_error "The function cannot work properly !!!" + fi +} From 7b91aab71fe1b3ad319f718f0e205c68f547c3a0 Mon Sep 17 00:00:00 2001 From: Nono95230 Date: Tue, 12 Nov 2019 17:01:40 +0100 Subject: [PATCH 2/7] Updating the Ruby version to be able to install compass. --- 5.3/Dockerfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/5.3/Dockerfile b/5.3/Dockerfile index 9b85635..9e0b3b4 100644 --- a/5.3/Dockerfile +++ b/5.3/Dockerfile @@ -16,13 +16,21 @@ RUN apt-get clean && apt-get update && \ graphviz \ php5-mcrypt php5-curl php5-memcached php5-xdebug php5-dev php-pear php-soap mysql-client php5-mysql php-apc \ make curl sudo git \ - ruby-dev rubygems \ zip \ wget \ vim \ linux-libc-dev \ libyaml-dev +# Installation of ruby +RUN cd /tmp && \ + wget https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.0-rc1.tar.gz && \ + tar -xzf ruby-2.4.0-rc1.tar.gz && \ + cd ruby-2.4.0-rc1/ && \ + ./configure && \ + make && \ + make install + # Install PECL packages # COPY docker-php-pecl-install /usr/local/bin/ RUN pecl install uploadprogress memcache yaml-1.2.0 From a467d040d5f1258a00dbb9b642e9e0e48bfc38fd Mon Sep 17 00:00:00 2001 From: Nono95230 Date: Tue, 12 Nov 2019 17:04:15 +0100 Subject: [PATCH 3/7] npm update broke npm. And it is impossible to install less(plugin). --- 5.3/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/5.3/Dockerfile b/5.3/Dockerfile index 9e0b3b4..c2ba38e 100644 --- a/5.3/Dockerfile +++ b/5.3/Dockerfile @@ -50,8 +50,7 @@ RUN curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - RUN DEBIAN_FRONTEND=noninteractive apt-get -yq --no-install-recommends install -y nodejs # Installation of LESS -RUN npm update -g npm && \ -npm install -g less && npm install -g less-plugin-clean-css +RUN npm install -g less && npm install -g less-plugin-clean-css # Installation of Grunt RUN npm install -g grunt-cli From 420f1ab3bbe93239bb1b33f97e2cf4f6fb4bcd28 Mon Sep 17 00:00:00 2001 From: Nono95230 Date: Tue, 12 Nov 2019 17:04:59 +0100 Subject: [PATCH 4/7] Updating the drush version. --- 5.3/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/5.3/Dockerfile b/5.3/Dockerfile index c2ba38e..7c3c93a 100644 --- a/5.3/Dockerfile +++ b/5.3/Dockerfile @@ -64,7 +64,7 @@ RUN cd /usr/src && mv composer.phar /usr/bin/composer # Installation of drush RUN git clone https://github.com/drush-ops/drush.git /usr/local/src/drush -RUN cd /usr/local/src/drush && git checkout 6.2.0 +RUN cd /usr/local/src/drush && git checkout 7.4.0 RUN ln -s /usr/local/src/drush/drush /usr/bin/drush RUN cd /usr/local/src/drush && composer update && composer install From e74f41e7b2104a252a2695fd83a0a3f0af516433 Mon Sep 17 00:00:00 2001 From: Nono95230 Date: Tue, 12 Nov 2019 17:11:47 +0100 Subject: [PATCH 5/7] Configuration for xdebug works. --- 5.3/Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/5.3/Dockerfile b/5.3/Dockerfile index 7c3c93a..ed87193 100644 --- a/5.3/Dockerfile +++ b/5.3/Dockerfile @@ -72,6 +72,16 @@ RUN rm -rf /var/www/html && \ mkdir -p /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html && \ chown -R www-data:www-data /var/lock/apache2 /var/run/apache2 /var/log/apache2 /var/www/html +# Configuration of Xdebug +RUN sed -i 's/^\(.*xdebug\.so\)/;\1/' /etc/php5/cli/conf.d/xdebug.ini &&\ + echo 'xdebug.remote_enable=on' >> /etc/php5/cli/conf.d/xdebug.ini &&\ + echo 'xdebug.remote_autostart=off' >> /etc/php5/cli/conf.d/xdebug.ini &&\ + echo 'xdebug.remote_connect_back=off' >> /etc/php5/cli/conf.d/xdebug.ini &&\ + echo 'xdebug.remote_host=docker_host' >> /etc/php5/cli/conf.d/xdebug.ini &&\ + echo 'xdebug.idekey=PHPSTORM' >> /etc/php5/cli/conf.d/xdebug.ini &&\ + echo 'xdebug.remote_port=9000' >> /etc/php5/cli/conf.d/xdebug.ini &&\ + echo 'xdebug.remote_log="/var/log/xdebug.log"' >> /etc/php5/cli/conf.d/xdebug.ini + # installation of ssmtp RUN DEBIAN_FRONTEND=noninteractive apt-get install --fix-missing -y ssmtp && rm -r /var/lib/apt/lists/* ADD core/ssmtp.conf /etc/ssmtp/ssmtp.conf From 6b4561f3070e44cdefc847c9d84725aabdb41a0f Mon Sep 17 00:00:00 2001 From: Nono95230 Date: Tue, 12 Nov 2019 17:12:34 +0100 Subject: [PATCH 6/7] Declare ServerName to avoid an error into apache2.conf file. --- 5.3/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/5.3/Dockerfile b/5.3/Dockerfile index ed87193..1703204 100644 --- a/5.3/Dockerfile +++ b/5.3/Dockerfile @@ -82,6 +82,9 @@ RUN sed -i 's/^\(.*xdebug\.so\)/;\1/' /etc/php5/cli/conf.d/xdebug.ini &&\ echo 'xdebug.remote_port=9000' >> /etc/php5/cli/conf.d/xdebug.ini &&\ echo 'xdebug.remote_log="/var/log/xdebug.log"' >> /etc/php5/cli/conf.d/xdebug.ini +# Declare ServerName to avoid an error +RUN echo 'ServerName localhost' >> /etc/apache2/apache2.conf + # installation of ssmtp RUN DEBIAN_FRONTEND=noninteractive apt-get install --fix-missing -y ssmtp && rm -r /var/lib/apt/lists/* ADD core/ssmtp.conf /etc/ssmtp/ssmtp.conf From 0b205909ef33204d8677d1be4acaa8c6c230a1bb Mon Sep 17 00:00:00 2001 From: Nono95230 Date: Tue, 12 Nov 2019 17:13:25 +0100 Subject: [PATCH 7/7] Cleaning the file and comments. --- 5.3/Dockerfile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/5.3/Dockerfile b/5.3/Dockerfile index 1703204..55b30a4 100644 --- a/5.3/Dockerfile +++ b/5.3/Dockerfile @@ -31,8 +31,7 @@ RUN cd /tmp && \ make && \ make install -# Install PECL packages -# COPY docker-php-pecl-install /usr/local/bin/ +# Installation of PECL packages RUN pecl install uploadprogress memcache yaml-1.2.0 RUN echo "extension=yaml.so" >> /etc/php5/apache2/conf.d/yaml.ini @@ -42,10 +41,10 @@ COPY core/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh RUN chmod +x /usr/local/bin/docker-entrypoint.sh RUN a2enmod rewrite -# SASS and Compass installation +# Installation of SASS and Compass RUN gem install compass -# Installation node.js +# Installation of node.js RUN curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash - RUN DEBIAN_FRONTEND=noninteractive apt-get -yq --no-install-recommends install -y nodejs @@ -62,7 +61,7 @@ RUN npm install -g gulp RUN cd /usr/src && curl -sS http://getcomposer.org/installer | php RUN cd /usr/src && mv composer.phar /usr/bin/composer -# Installation of drush +# Installation of Drush RUN git clone https://github.com/drush-ops/drush.git /usr/local/src/drush RUN cd /usr/local/src/drush && git checkout 7.4.0 RUN ln -s /usr/local/src/drush/drush /usr/bin/drush @@ -85,7 +84,7 @@ RUN sed -i 's/^\(.*xdebug\.so\)/;\1/' /etc/php5/cli/conf.d/xdebug.ini &&\ # Declare ServerName to avoid an error RUN echo 'ServerName localhost' >> /etc/apache2/apache2.conf -# installation of ssmtp +# Installation of ssmtp RUN DEBIAN_FRONTEND=noninteractive apt-get install --fix-missing -y ssmtp && rm -r /var/lib/apt/lists/* ADD core/ssmtp.conf /etc/ssmtp/ssmtp.conf ADD core/php-smtp.ini /etc/php5/apache2/conf.d/php-smtp.ini @@ -94,7 +93,7 @@ RUN a2enmod rewrite expires VOLUME /var/www/html -# create directory for ssh keys +# Create directory for ssh keys RUN mkdir /var/www/.ssh/ RUN chown -R www-data:www-data /var/www/ RUN chmod -R 600 /var/www/.ssh/