diff --git a/docker-compose.yml b/docker-compose.yml index 5013507..355d458 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,6 +11,7 @@ services: - INSTALL_MONGO=false - INSTALL_XDEBUG=false - INSTALL_NODE=false + - INSTALL_DRUSH=false - COMPOSER_GLOBAL_INSTALL=false - PUID=1000 - PGID=1000 @@ -33,6 +34,7 @@ services: - INSTALL_XDEBUG=false - INSTALL_ZIP_ARCHIVE=false - INSTALL_MEMCACHED=false + - INSTALL_OPCACHE=false dockerfile: Dockerfile-70 volumes_from: - volumes_source diff --git a/nginx/sites/framework-examples/drupal_8.conf b/nginx/sites/framework-examples/drupal_8.conf new file mode 100644 index 0000000..a5d398a --- /dev/null +++ b/nginx/sites/framework-examples/drupal_8.conf @@ -0,0 +1,59 @@ +server { + listen 80; + listen [::]:80; + + #domain name + server_name drupal8.dev; + + #file document root. This has to match one of the volumes in docer-composer.yml + root /var/www/drupal8; + + # This is the full path to your index file + index index.php index.html index.htm; + + + ## serve imagecache files directly or redirect to drupal if they do not exist. + location ~* files/styles { + access_log off; + expires 30d; + try_files $uri @drupal; + } + + ## serve imagecache files directly or redirect to drupal if they do not exist. + location ~* ^.+.(xsl|xml)$ { + access_log off; + expires 1d; + try_files $uri @drupal; + } + + ## Images and static content is treated different + location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { + access_log off; + expires 30d; + } + + location / { + index index.php; + # This is cool because no php is touched for static content + try_files $uri $uri/ @rewrite; + expires max; + } + + location @drupal { + rewrite ^/(.*)$ /index.php?q=$1 last; + } + + + location @rewrite { + # Some modules enforce no slash (/) at the end of the URL + # Else this rewrite block wouldn't be needed (GlobalRedirect) + rewrite ^/(.*)$ /index.php?q=$1; + } + + location ~ .php$ { + fastcgi_pass php-upstream; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } +} \ No newline at end of file diff --git a/php-fpm/Dockerfile-56 b/php-fpm/Dockerfile-56 index 75daf66..62ac6f9 100644 --- a/php-fpm/Dockerfile-56 +++ b/php-fpm/Dockerfile-56 @@ -89,6 +89,16 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ docker-php-ext-enable memcached \ ;fi +##################################### +# Opcache: +##################################### +ARG INSTALL_OPCACHE=true +ENV INSTALL_OPCACHE ${INSTALL_OPCACHE} +RUN if [ ${INSTALL_OPCACHE} = true ]; then \ + docker-php-ext-install opcache && \ + docker-php-ext-enable opcache \ +;fi + # #-------------------------------------------------------------------------- diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index ca129bb..8c296ce 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -100,6 +100,17 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ && docker-php-ext-enable memcached \ ;fi +##################################### +# Opcache: +##################################### +ARG INSTALL_OPCACHE=true +ENV INSTALL_OPCACHE ${INSTALL_OPCACHE} +RUN if [ ${INSTALL_OPCACHE} = true ]; then \ + docker-php-ext-install opcache && \ + docker-php-ext-enable opcache \ +;fi + + # #-------------------------------------------------------------------------- diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 31d47ec..e5338f6 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -37,6 +37,7 @@ MAINTAINER Mahmoud Zalt # - INSTALL_MONGO= false # - COMPOSER_GLOBAL_INSTALL= false # - INSTALL_NODE= false +# - INSTALL_DRUSH= false # ##################################### @@ -97,6 +98,22 @@ RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \ composer global install \ ;fi +##################################### +# Drush: +##################################### +USER root +ENV DRUSH_VERSION 8.1.2 +ARG INSTALL_DRUSH=true +ENV INSTALL_DRUSH ${INSTALL_DRUSH} +RUN if [ ${INSTALL_DRUSH} = true ]; then \ + # Install Drush 8 with the phar file. + curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \ + chmod +x /usr/local/bin/drush && \ + drush core-status \ +;fi + +USER laradock + ##################################### # Node / NVM: #####################################