Overview

These are the minimal steps to take if you set up and work with a project:

  1. Create a new project (once per project)
  2. Setup the environment (once per project)
  3. Install Drupal and a drupal site (once per project)
  4. Start/Stop the containers and use tools (regularly, as needed)

If you run into troubles check the Troubleshooting section.


Quick start

To setup a new project, see Fresh install of Drupal section below.

To setup the environment in an existing project powered by Drucker, follow these commands:

$ cd <name of the project>
# Initialize the Drucker Git submodule
$ git submodule init
$ git submodule update
# Install all the dependencies
$ cd drucker
$ source load-env
$ drucker install
# Run the stack
$ drucker start

The script will create your personal drucker.config file during installation (see Config section).

Now you can open the website at http://www.*PROJECT_NAME_PLAIN*.local (or http://*SUBNET*.101 if you could not change /etc/hosts).

Change the /etc/hosts if you are root, in order to use hostnames instead of IPs.

Here's the list of all domains/IPs:

Name Hostname IP
PHP http://php.PROJECT_NAME_PLAIN.local http://SUBNET.100
WWW http://www.PROJECT_NAME_PLAIN.local http://SUBNET.101
DB http://db.PROJECT_NAME_PLAIN.local http://SUBNET.102
MAIL http://mail.PROJECT_NAME_PLAIN.local http://SUBNET.103
PMA http://pma.PROJECT_NAME_PLAIN.local http://SUBNET.104

The default credentials for Drupal is:


Loading the environment

Before any Drucker operation, you need to have variables loaded in your environment:

$ cd drucker
$ source load-env

This will setup aliases to use in your bash environment, in your current session.

You can now use the command drucker to manipulate the project:

You can alose use some tools, like Drush or Composer, in a transparent way like if they are installed locally:

See Tools section for the full documentation of these tools.

Tips: You have shortcuts aliases: - home : to go directly inside the project dir


Directory structure

During setup, the directory structure will become something like this:

  • Project
    • drucker
      • docker-runtime
        • console
        • drush
        • drush-backups
        • log
        • mysql
        • mysql-init
        • sql-backups
      • load-env
    • drucker.config
    • www
      • config/sync
      • drush
      • scripts/composer
      • private
      • tmp
      • web

Config

The configuration of the Drucker is inside the drucker.config file, in the root folder.

With this variables, the names of all containers, networks and host/domainnames are built. They must be unique on the host machine.

This file is automatically generated when you install or run the stack.

This file is personal and must be GIT ignored!

It contains some config variables:

See Features/Multiple-Projects to know how to configure it for running multiple projects in parallel.

You can (re-)generate it using drucker gen-config.


Fresh install of Drupal (new project)

The Drupal will be installed with Composer, using drupal-composer project.

To create a new project using Drucker, follow these commands:

# Create an empty folder for your project
$ mkdir <name of the project>
$ cd <name of the project>
# Initialize an empty GIT project
$ git init
# Add Drucker in your project, as a Git submodule
$ git submodule add https://github.com/ovh/drucker.git drucker
# Launch a fresh install of Drupal
$ cd drucker
$ source load-env
$ drucker init
# Install all the dependencies
$ drucker install
# Run the stack
$ drucker start

When installing the given composer.json some tasks are taken care of:

All the contrib folders and settings files must be GIT ignored.


Updating Drupal Core

Follow the steps to update your core files here.


Using in production

Drucker is a development environment only. DO NOT USE IT IN PRODUCTION.


Containers used

The Drucker stack consist of the following containers:

Container Versions Service name Image
Nginx 1.13 nginx [wodby/drupal-nginx]
Apache 2.4 apache [wodby/drupal-apache]
Drupal 8 php [wodby/drupal]
PHP 7.1, 7.0 php [wodby/drupal-php]
MariaDB 10.1 mariadb [wodby/drupal-mariadb]
Mailhog latest mailhog [mailhog]
phpMyAdmin latest pma [phpmyadmin]
Node.js 8, 8-alpine node [node]

Some of the containers are overrided, see lib/docker-images.