Sign inSign up

klambt/drupal

By klambt

•Updated over 8 years ago

Docker for Drupal 8, Thunder, Drupal 7 Web Applications

Image
1

50K+

klambt/drupal repository overview

⁠klambt/drupal

Alpha Version - This Docker is still in development

This Dockerimage is intented to be used as a Drupal Base Image for our Sites. You may use it, at your own risk. The Image is based on klambt/webserver (Dockerhub⁠ or Github⁠) which is an enhanced image of php:7.0-apache⁠.

This Docker is intended to be highly customizable, to:

  • fit our needs
  • being able to making it public

It is possible to run it as a "Clean Install" or with an Preloaded Database (Update). Modules and Debian Packages can be added at Runtime or Build.

⁠PULL

docker pull klambt/drupal:latest

⁠Building

docker build -t klambt/drupal:latest .

⁠Autobuild

This Image will be updated if:

  • The php⁠ Base Image is Updated (hook)
  • The drupal⁠ Image is Updated (hook)
  • We change it in github

###TAGS

tagdescriptionsize
latestcurrently drupal 7 for development purposes
drupal-8Latest Drupal 8.x⁠ Version
thunderLatest Thunder⁠ Version
drupal-7Latest Drupal 7.x Version
drupal-6Drupal 6 Version - Just to test if we can be flexible with this docker (php:5.6-apache⁠)
⁠Drupal 7 Modules enabled

⁠Settings & Customization

In the next Section, we will describe howto use some of our customizing options. In the Example Section, we will describe some usecases (still in progress)

⁠Core Hacks

We will not support Core Hacks

⁠Modules & Themes

There are several Methods to integrate & install Modules at Buildtime and Runtime to this Docker:

  • Public Themes and Modules can be added during Build:
  • by modify the file [Dockerroot]/conf/drupal-7-modules.conf to your needs. It is a Textfile with one modulename in each line. The Modules will be downloaded and installed via drush.
  • by setting the Environment DRUPAL_INSTALL_MODULES to a list of your chosing (seperated by ",");
  • Private Themes and Modules can be added during Build:
  • by adding them to the custom_modules and custom_themes Folder
  • by pulling them directly from your git repository (see Environment Options)

⁠Environment Options

⁠Build
optiondescriptionDefault Values
UPDATE_DEBIANUpdate Debian Packages1 = true
DEBIAN_INSTALL_PACKAGESInstall Debian Packages, seperated by ","0 = false
INSTALL_DRUSHInstall Drush⁠1 = true
INSTALL_DRUPALInstall Drupal⁠1 = true
DRUPAL_INSTALL_MODULESInstall Drupal Modules, seperated by ","0 = false
GIT_PULL_CUSTOMPull Private Modules & Themes from GitHub0 = false
GIT_CUSTOM_SOURCES_SERVERGit Servergithub.com
GIT_CUSTOM_SOURCES_REPOSGit Directory (for example klambt/docker_drupal)0 = false
GIT_USERNAMEGit Username0 = false
GIT_PASSWORDGit Password0 = false
GIT_CUSTOM_MODULES_PATHModules Path inside the git repository0 = false
GIT_CUSTOM_THEMES_PATHThemes Path inside the git repository0 = false
USE_NFS_CLIENTInstall NFS Client1 = true
⁠Runtime
optiondescriptionDefault Values
DEBIAN_INSTALL_PACKAGESInstall Debian Packages, seperated by ","0 = false
DRUPAL_USERNAMEAdmin Username (User 0)admin
DRUPAL_USER_PASSWORDAdmin Passwordgenerated
DRUPAL_USER_MAILAdmin User E-Mail Adress[email protected]⁠
DRUPAL_SITE_MAILE-Mail Adress of the Site[email protected]⁠
DRUPAL_MEMCACHE_SERVERLinkname or Hostname to Memcache Server0 = disabled
DRUPAL_VARNISH_SERVERLinkname or Hostip to Varnish Server0 = disabled
DRUPAL_VARNISH_KEYVarnish Key to Ban Content on Varnish Server---
DRUPAL_INSTALL_MODULESInstall Drupal Modules, seperated by ","0 = false
MYSQL_DATABASEDrupal Databasedrupal
MYSQL_USERUsernamedrupal
MYSQL_PASSWORDUser Passworddrupal
MYSQL_LINKLinkname or Hostname to Database Serverdatabase_server
GIT_PULL_CUSTOMPull Private Modules & Themes from GitHub0 = false
GIT_CUSTOM_SOURCES_SERVERGit Servergithub.com
GIT_CUSTOM_SOURCES_REPOSGit Directory (for example klambt/docker_drupal)0 = false
GIT_USERNAMEGit Username0 = false
GIT_PASSWORDGit Password0 = false
GIT_CUSTOM_MODULES_PATHModules Path inside the git repository0 = false
GIT_CUSTOM_THEMES_PATHThemes Path inside the git repository0 = false
DRUPAL_FILE_NFS_DIRNFS location of /sites/default/files0 = false
USE_NFS_CLIENTInstall NFS Client0 = true
DRUPAL_FILE_NFS_DIRnfs path for /sites/default/files0 = false
NFS_OPTIONSNFS Mount Options--options=nolock,exec

⁠Directorys

⁠[klambt/docker_drupal] (https://github.com/klambt/docker_drupal⁠)
pathdescription
conf/Configuration Files
custom_modules/Custom Modules to be integrated at Build
custom_themes/Custom Themes to be integrated at Build
scripts/klambt_docker_*.shLogic to get everything up and running
Dockerfiletag:latest
⁠Dockerimage
pathdescription
/var/www/html/Drupal Base
/var/www/html/sites/default/filesPublic Files
/var/www/privatePrivate Files
/tmp/drupalTemp Files
/var/www/html/sites/all/modules/customCustom Modules
/var/www/html/sites/all/themes/customCustom Themes
/usr/local/bin/klambt_docker_*.shConfiguration Scripts

⁠Examples

The following example for Development, will start an clean installed drupal, with working memcache, varnish, solr integration. It is intended to get a working Drupal Installation up in couple of Minutes.

Since it is a Development Deployment, we will expose the Ports:

  • 8983 for SOLR Administration
  • 3306 for MySQL
  • 81 for PHPMyAdmin
  • 80 for Drupal

We will need three files in the same directory.

docker-compose.yml

version: '2'
services:
  drupal_memcached:
    image: memcached:alpine
    container_name: drupal_memcached
    networks:
      - klambt_drupal
  drupal_database:
    image: mysql:5.7
    container_name: drupal_database
    networks:
      - klambt_drupal
    ports:
      - "3306:3306"
    env_file:
      - ./database.env
  phpmyadmin:
    image: phpmyadmin/phpmyadmin:latest
    container_name: drupal_phpmyadmin
    networks:
      - klambt_drupal
    ports:
      - "81:80" 
    depends_on:
      - drupal_database  
  drupal_webserver:
    image: klambt/drupal:latest
    container_name: drupal_webserver
    networks:
      - klambt_drupal
    env_file:
      - ./database.env
      - ./drupal.env
      - ./varnish.env      
    depends_on:
      - drupal_database  
    privileged: true 
  drupal_varnish:
    image: klambt/varnish:latest
    container_name: drupal_varnish   
    networks:
      - klambt_drupal
    env_file:
      - ./varnish.env       
    ports:
      - "80:80"
    expose:
      - "6082"
    depends_on:
      - drupal_webserver 
  drupal_solr:
    image: klambt/solr
    container_name: drupal_solr
    networks:
      - klambt_drupal
    expose:
      - "8983"

networks:
  klambt_drupal:
    driver: bridge 

drupal.env

DRUPAL_USERNAME=admin
[email protected]
[email protected]
DRUPAL_MEMCACHE_SERVER=drupal_memcached
DRUPAL_VARNISH_SERVER=drupal_varnish
DRUPAL_LOCALE=de_DE

database.env

MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=drupal
MYSQL_USER=drupal
MYSQL_PASSWORD=drupal
MYSQL_PORT=3306
MYSQL_LINK=drupal_database

varnish.env

DRUPAL_VARNISH_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
BACKEND_SERVER=drupal_webserver
BACKEND_STYLE=drupal-7

Starting up our Service with a single command:

docker-compose up

more documentation to follow

Tag summary

Content type

Image

Digest

Size

236.7 MB

Last updated

over 8 years ago

docker pull klambt/drupal