Skip to content
Snippets Groups Projects
drupal.md 8.84 KiB
title: Docker L3D and Drupal Projects
tags:
- docker

L3D and Drupal Projects

Introduction and overview

We do provide a couple of project templates for Drupal projects out of the box:

If you prefer to use your own prroject template, you'll get the most out of L3D if you add our ccomposer plugin drupal-development-environment to your required dev components:

composer require --dev lakedrops/drupal-development-environment

This comes with all the dependencies, that help you in local Drupal development:

You'll find the documentation for each of these tools in their own section.

In the current context, just an extra note on the drupal-environment plugin: this has been moved out of drupal-development-environment and contains all the tasks and templates to initially build the directory structure and setting files.

It is a great idea to utilize the same structure in your production environment too. To get there, you can simply add this plugin to your regular requirements:

composer require lakedrops/drupal-environment

In both cases, development and production, your project settings for this toolset goes into the file .lakedrops.yml in your project root and each project describes in its own documentation, what values go into this file so that you get similar (but not identical) setup on all stages. It should not be identical, because you don't want all the development tools on your production site.

Working with multiple projects in parallel

The composer plugin Docker4Drupal in combination with the composer library Traefik automatically configures your host for zero-setup always working routing for any number of projects in parallel.

Everything is based on a project ID which has to be unique on a single host. Ideally the ID should be short and only contain characters and numbers. The ID will be part of the domain-name under which this project will be opened in the browser locally and maybe even within your LAN.

The ID will be stored in a variable called COMPOSE_PROJECT_NAME which is stored in the .env file in the root of your project. For this documentation we continue by using the sample ID project1.

Based on this ID, ...

  • L3D builds the main container called project1_l3d
  • Traefik creates a Docker network called traefik_project1
  • Docker4Drupal creates a number of containers depending on the services you require, e.g.
    • project1_apache_1
    • project1_mailhog_1
    • project1_mariadb_1
    • project1_php_1
    • project1_pma_1
    • project1_redis_1
  • Node and NPM will create a container project1_l3d_node