diff --git a/Dockerfile b/Dockerfile index 728e9b9..2aef76f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM drupal:9.5-php8.0 MAINTAINER devel@goalgorilla.com # Install packages. -RUN apt-get update && apt-get install -y \ +RUN apt-get clean && apt-get update && apt-get install -y \ zlib1g-dev \ libssl-dev \ libxml2-dev \ @@ -34,15 +34,7 @@ RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && mv composer.phar /usr/local/bin/composer && \ php -r "unlink('composer-setup.php');" - -# Install Open Social via composer. -RUN rm -f /var/www/composer.lock -RUN rm -rf /root/.composer - -ADD composer.json /var/www/composer.json -WORKDIR /var/www/ ENV COMPOSER_ALLOW_SUPERUSER=1 -RUN COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist --no-interaction --no-dev WORKDIR /var/www/html/ RUN chown -R www-data:www-data * @@ -52,7 +44,17 @@ RUN wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/down chmod +x drush.phar && \ mv drush.phar /usr/local/bin/drush -RUN php -r 'opcache_reset();' +# GMP library. +RUN apt-get install -y libgmp-dev +RUN ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/local/include/ +RUN docker-php-ext-configure gmp +RUN docker-php-ext-install gmp + +# Redis. +RUN pecl install redis \ + && docker-php-ext-enable redis # Fix shell. RUN echo "export TERM=xterm" >> ~/.bashrc + +RUN php -r 'opcache_reset();' diff --git a/ci/Dockerfile b/ci/Dockerfile index 317afc8..e53093d 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -1,26 +1,8 @@ -FROM goalgorilla/open_social_docker:latest +FROM goalgorilla/open_social_docker:latest-drupal95 MAINTAINER devel@goalgorilla.com -# Specify the work directory. -WORKDIR /var/www/ - -ADD php.ini /usr/local/etc/php/php.ini - ### CI SPECIFIC - START ### - -# GMP library. -RUN apt-get install -y libgmp-dev -RUN ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/local/include/ -RUN docker-php-ext-configure gmp -RUN docker-php-ext-install gmp - -# Install composer dependencies. -RUN composer install --prefer-dist --no-interaction - -# Unfortunately, adding the composer vendor dir to the PATH doesn't seem to work. So: -RUN ln -s /root/.composer/vendor/bin/behat /usr/local/bin/behat -RUN ln -s /root/.composer/vendor/bin/phpunit /usr/local/bin/phpunit - +ADD php.ini /usr/local/etc/php/php.ini ### CI SPECIFIC - END ### RUN php -r "opcache_reset();" diff --git a/dev/Dockerfile b/dev/Dockerfile index f8d41a0..b5e4d3d 100644 --- a/dev/Dockerfile +++ b/dev/Dockerfile @@ -1,31 +1,10 @@ -FROM goalgorilla/open_social_docker:latest +FROM goalgorilla/open_social_docker:latest-drupal95 MAINTAINER devel@goalgorilla.com -### CI SPECIFIC - START ### -### - Making changes here? Also apply in ../ci/Dockerfile ### - -# Specify the work directory. -WORKDIR /var/www/ - -# Install composer dependencies. -RUN composer install --prefer-dist --no-interaction - -# Unfortunately, adding the composer vendor dir to the PATH doesn't seem to work. So: -RUN ln -s /root/.composer/vendor/bin/behat /usr/local/bin/behat -RUN ln -s /root/.composer/vendor/bin/phpunit /usr/local/bin/phpunit - -### CI SPECIFIC - END ### - ### DEV SPECIFIC - START ### ADD php.ini /usr/local/etc/php/php.ini -# GMP library. -RUN apt-get install -y libgmp-dev -RUN ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/local/include/ -RUN docker-php-ext-configure gmp -RUN docker-php-ext-install gmp - # Xdebug. RUN pecl install xdebug-3.1.1 && \ docker-php-ext-enable xdebug && \ @@ -35,28 +14,6 @@ RUN pecl install xdebug-3.1.1 && \ sed -i '1 a xdebug.client_host=host.docker.internal' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \ sed -i '1 a xdebug.idekey=PHPSTORMi' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini -# Blackfire -# @todo Fix PHP 8 based blackfire installation -#RUN version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ -# && architecture=$(uname -m) \ -# && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/$architecture/$version \ -# && mkdir -p /tmp/blackfire \ -# && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp/blackfire \ -# && mv /tmp/blackfire/blackfire-*.so $(php -r "echo ini_get ('extension_dir');")/blackfire.so \ -# && printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8307\n" > $PHP_INI_DIR/conf.d/blackfire.ini \ -# && rm -rf /tmp/blackfire /tmp/blackfire-probe.tar.gz - -RUN php -r "opcache_reset();" - -# @todo Remove these steps as it is not required for latest Docker desktop. -# Contains the Mac hack to get the permissions to work for development. -# Set user 1000 and group staff to www-data, enables write permission. -# https://github.com/boot2docker/boot2docker/issues/581#issuecomment-114804894 -#RUN usermod -u 1000 www-data -#RUN usermod -G staff www-data - ### DEV SPECIFIC - END ### -# Redis. -RUN pecl install redis \ - && docker-php-ext-enable redis +RUN php -r "opcache_reset();"