-
About
DrupalBox is a template Drupal project that can be used to seed (create) a new Drupal project quickly and easily.
The new project will contain:
- A Drupal profile (which can also be based on the OpenAtrium profile).
- Makefiles for downloading the Drupal core, all the needed modules, libraries, patches, etc.
- Scripts for installing a minimal Ubuntu server inside a Docker container, with all the packages and configurations needed for running a Drupal application.
- Scripts, modules, tools and docs that facilitate the development, including a dev-->test-->live workflow.
-
Motivation
The aim of this project is to be like a "Drupal-on-Rails" for helping the new Drupal developers to get started and for simplifying the life of the experienced Drupal developers.
Usually a huge number of skills is needed in order to complete successfully a Drupal project, like: server management, web stack management, database management, knowledge of drush, Drupal profiles, frequently used modules, common Drupal development patterns and paradigms, etc. A new Drupal developer cannot possibly get all this skills in a short time, so he is not able to finish properly a Drupal application or it will take him a very long time. This project offers them a Drupal solution that works out of the box, with reasonable settings and configurations, which they can use as a starting point for developing their application.
This project can also simplify the life of the experienced Drupal developers, by allowing them to get started quickly, and then customizing the solution as they wish.
-
Create a new project
A new project is created by renaming files of the template project and doing find/replace in them.
#+BEGIN_EXAMPLE
git clone https://github.com/dashohoxha/dbox.git cp -a dbox myproject cd myproject/
./rename-project.sh # see usage ./rename-project.sh labdoo:myproject lbd:proj
git init . git add . git commit -m 'Initial commit.' #+END_EXAMPLE
The script
rename-project.shworks by renaming files of the template project and doing find/replace in them. There are two parameters that are used to customize the template project: the /project name/ and the /project prefix/. In the template project they are represented by labdoo and lbd, which are then replaced in the new project by the new project’s name and prefix.Why these strange names? Why not use something like example and xmp, or sample and smp, or template and tmp etc.
The main reason is exactly that they are strange names and so there is no risk of collision with other names used in a project. For example xmp or template or tmp maybe are used on the project for something else as well, and replacing them blindly with a new value may break the application.
-
Install the new project
Installation is done inside a Docker container. For instructions about installing Docker see: https://docs.docker.com/installation/
-
Create a working directory: #+BEGIN_EXAMPLE mkdir workdir/ #+END_EXAMPLE
-
Link the docker directory inside the working directory: #+BEGIN_EXAMPLE cd workdir/ ln -s ../myproject/docker . #+END_EXAMPLE
-
Modify and customize the settings: #+BEGIN_EXAMPLE cp docker/settings.sh . vim settings.sh #+END_EXAMPLE
-
Build a Docker image: #+BEGIN_EXAMPLE docker/build.sh settings.sh tail -f logs/nohup-myproject-master-20150929.out less -r logs/nohup-myproject-master-20150929.out #+END_EXAMPLE This will create a docker image, named =myproject:master= with a minimal ubuntu system and everything that is needed for the normal work of the Drupal application.
-
Create a Docker container like this: #+BEGIN_EXAMPLE docker/create.sh #+END_EXAMPLE It will create a container with port forwarding like this: =-p 80:80 -p 443:443 -p 2201:2201=. If you don't like the default port forwarding, edit
configand modify it, before creating the container. -
Now you can start and stop the container with =docker/start.sh= and =docker/stop.sh=, enter the shell of the container with =docker/enter.sh=, etc.
-
If =development=true= is set on the settings, then the code of the application inside the container will be linked to the directory
myproject/, so that you can edit and work on it easily. -
If it is installed on a local machine (for testing or development), add the domain name =example.org= on
/etc/hosts, like this: #+BEGIN_EXAMPLE 127.0.0.1 example.org #+END_EXAMPLE This way it can be accessed by typing =https://example.org= on the browser location (not =https://127.0.0.1= or =https://localhost=).
-
-
Quick install
An easier way to install is by using the script
utils/docker-install.shwhich automates the steps above, with certain conventions for directory names etc. #+BEGIN_EXAMPLE vim utils/docker-install.sh utils/docker-install.sh --domain=test.example.org or utils/docker-install.sh $(pwd)/settings.sh
--git_branch=test --domain=test.example.org #+END_EXAMPLEThis script also installs [[https://github.com/docker-build/wsproxy][wsproxy]], which allows to run more that one containers with ports 80/443. For this to work, the variable =ports= on
configis set to empty, so that docker does not forward the ports 80 and 443 to the containers. The HTTP request forward to the correct website container is handled by the wsproxy container, based on the domain name.NOTE: Although =utils/docker-install.sh= is handy for making a quick installation, it is highly recommended to read and understand this script, because this will be helpful for maintaining the installation. It is not so long and it is easy to understand.
-
Change configuration
To change the configuration of the server after it has been built, or in case of using a pre-built image, run: #+BEGIN_EXAMPLE docker/exec.sh install/config.sh #+END_EXAMPLE and give the new settings interactively.
Another option is to edit the configuration settings file and give it as a argument to the script: #+BEGIN_EXAMPLE docker/enter.sh cp install/settings.sh . vim settings.sh install/config.sh settings.sh #+END_EXAMPLE
It is also possible to run configuration scripts individually, to change only certain configurations. For example: #+BEGIN_EXAMPLE docker/exec.sh install/config/domain.sh #+END_EXAMPLE These scripts can be found on
install/config/. -
Documentation
-
Internal doc files:
-
External docs:
-
Other docs that may help:
- http://info.btranslator.org/docker-workshop/
- http://codeinthehole.com/writing/pull-requests-and-other-good-practices-for-teams-using-github/
- http://dashohoxha.fs.al/how-to-secure-ubuntu-server/
- http://dashohoxha.fs.al/howto-manage-your-own-nameserver/
- http://www.havetheknowhow.com/Configure-the-server/Install-ssmtp.html
- http://arstechnica.com/security/2009/12/how-to-get-set-with-a-secure-sertificate-for-free/
-
Dbox
DrupalBox: A template Drupal project that can be used to seed (create) new Drupal projects quickly and easily. DEPRECATED. Use: https://github.com/docker-scripts/dbox
Package Owner
Package Info
Related