From 2e8ee2125c2d95e20b9241de468ba23e72500ee8 Mon Sep 17 00:00:00 2001 From: Luca Pattocchio Date: Thu, 14 Oct 2021 16:49:24 +0200 Subject: [PATCH] v1.0.1 (#4) * Init: GDRCD#5.5.1 stack * FIX: Remove references to phpmyadmin * NEW: PHPMyAdmin restored; FIX: Improved web host management; * NEW: Add multiples services; FIX: README.md * FIX: Remove only_full_group_by restriction; Improve example.php.conf. * FIX: Implemented method for sending emails for testing. * FIX: Inhibited automatic restart of the mailhog container by default. * fix(docker): removed dipends_on entries, correction in port writing; * fix(conf): server_name alignment for phpmyadmin.con; * fix(conf): set up a default server for nginx; updated README file for multiple projects.; * upd: Refactor of the main components of the stack * fix: Removed inconsistent references * Update README.md (cherry picked from commit 6aa5b1dff885790a406f30bd82d3a3159dbbcbc2) * fix: Remove services folder * Create default service folder (cherry picked from commit 206f6f9cd75cbac167d5edb3ce1a1687d2c3c446) * fix(docker-compose): removed impurities on service volume * fix(docker/php): Removed unused variables; Softer Autoclean. * fix(docker/php): Readability improved for php.ini file * fix(docker): More explanatory configurations for php and nginx container * fix(docker/php): fixed path for inserting php configuration files * fix(env): Removed spaces in env variables (cherry picked from commit bb9952ffa43ff90d1233b093e200d0160abf5143) * fix(README): fixed link for git clone (cherry picked from commit 03c490b5b043c3d266b459afa6f45cd84bce094b) * fix(php): now the php.ini file is read correctly by docker * fix(php): now the php.ini file is read correctly by docker * fix(php): add more pre installed extensions; optimize image clean up; add more efficient sendmailer Co-authored-by: Kasui92 Co-authored-by: Stefano Campanella --- .docker/php/Dockerfile | 27 ++++++++++++++++++++++++--- .docker/php/conf.d/php.ini | 28 ++++++++++++++-------------- docker-compose.yml | 2 +- 3 files changed, 39 insertions(+), 18 deletions(-) diff --git a/.docker/php/Dockerfile b/.docker/php/Dockerfile index 6834a48..d14d9b1 100644 --- a/.docker/php/Dockerfile +++ b/.docker/php/Dockerfile @@ -12,12 +12,24 @@ RUN apt-get -y --no-install-recommends install --fix-missing \ git nano wget dialog \ apt-utils build-essential \ zip openssl curl \ + libmcrypt4 \ + libvpx4 \ + libfreetype6 \ + libjpeg62-turbo \ + libpng16-16 \ + libxpm4 \ libsqlite3-dev \ libsqlite3-0 \ - default-mysql-client \ + mysql-client \ + libmcrypt-dev \ zlib1g-dev \ libzip-dev \ libicu-dev \ + libpng-dev \ + libjpeg-dev \ + libfreetype6-dev \ + libxpm-dev \ + libvpx-dev \ libonig-dev \ libcurl3-dev \ libcurl3-openssl-dev \ @@ -34,7 +46,11 @@ RUN echo "Installing PHP extensions" && \ docker-php-ext-install json && \ docker-php-ext-install zip && \ docker-php-ext-install mbstring && \ - docker-php-ext-install gettext + docker-php-ext-install gettext && \ + docker-php-ext-install mcrypt && \ + docker-php-ext-install opcache && \ + docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-xpm-dir=/usr/include/ --with-vpx-dir=/usr/include/ && \ + docker-php-ext-install gd # Other PHP5.6 Extensions RUN echo "Enabling PHP extensions" && \ @@ -60,8 +76,13 @@ RUN echo "Install Redis" \ && pecl install redis-2.2.8 \ && docker-php-ext-enable redis +# Install sendmailer for Mailhog +RUN curl --location --output /usr/local/bin/mhsendmail https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 \ + && chmod +x /usr/local/bin/mhsendmail + # Clean up, try to reduce image size -RUN apt-get autoremove -y \ +RUN apt-get remove -y libmcrypt-dev libicu-dev libpng-dev libjpeg-dev libfreetype6-dev libxpm-dev libvpx-dev gcc gcc-6 \ + && apt-get autoremove -y \ && apt-get clean all \ && rm -rf /var/lib/apt/lists/* \ && rm -rf /tmp/* diff --git a/.docker/php/conf.d/php.ini b/.docker/php/conf.d/php.ini index 0f69018..09be8cd 100644 --- a/.docker/php/conf.d/php.ini +++ b/.docker/php/conf.d/php.ini @@ -1,12 +1,17 @@ ; PHP Configuration +[PHP] +; Error handling +display_errors=On + +; EXTENSIONS +extension=intl.so +extension=mysqli.so +extension=zip.so -[Date] +[date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone -date.timezone = UTC - -; Error handling -;display_errors = Off +date.timezone = "Europe/Rome" ; Xdebug ; See https://xdebug.org/docs/all_settings @@ -24,8 +29,8 @@ xdebug.remote_port=9000 [intl] intl.default_locale = -[opache] -; OPACHE +; OPCACHE +[opcache] cgi.fix_pathinfo=0; opcache.memory_consumption=128; opcache.interned_strings_buffer=8; @@ -35,10 +40,5 @@ opcache.fast_shutdown=1; opcache.enable_cli=1; ; MAILHOG -[sendmail] -sendmail_path = sendmail -S mailhog:1025; - -; EXTENSIONS -extension=intl -extension=mysqli -extension=zip \ No newline at end of file +[mail function] +sendmail_path = "/usr/local/bin/mhsendmail --smtp-addr=mailhog:1025" diff --git a/docker-compose.yml b/docker-compose.yml index 728362a..faea120 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: ports: - '9000:9000' volumes: - - ./.docker/php/conf.d:/usr/local/etc/php-5/conf.d + - ./.docker/php/conf.d:/usr/local/etc/php/conf.d:ro - ./service:/var/www/html environment: MYSQL_USER: ${MYSQL_USER}