jerrac / waterdrop

Waterdrop is a Drupal 10 in Docker quickstart project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Waterdrop

Waterdrop is a Drupal 10 in Docker quickstart project. Just run the initialize script, update composer.json with your project info, build the dev image, and run docker compose -f dev.run.yml up and you have a working Drupal 10 instance. Well, almost, still need to do an install.

It is meant to get a development environment up and running quickly. I include Asset Packagist configuration and use s6-overlay to run both Apache and Varnish in the same image.

I have structured it the same as my various production apps, since I will be using it to launch full apps. But, over the years I have found that when apps try to tell me how to run them in production, there is always something that just doesn't fit in my environment. So I leave how you go from dev to prod, up to you.

NOTE: When you move to prod, make sure you think through all the settings with security in mind. Waterdrop is made with development in mind. It is NOT secure.

Prerequisites

You should have Docker installed along with the Docker Compose plugin.

The .sh scripts expect to use Bash. So it needs to be installed.

jq is used to manipulate composer.json so it needs to be installed.

Usage

Initialization

Run bash scripts/init.sh --help to see the available options.

In general, bash scripts/init.sh --project-name < something > --host-port < available port > --db-host-port < available port > will get you started.

Don't run the scripts/init.sh more than once without removing everything it added.

Building

After initialization, run bash scripts/build-dev.sh.

Running

Just run via Docker Compose.

docker compose -f dev.run.yml up -d --force-recreate

Installation

After installation:

  • Be sure to copy the $settings['hash_salt'] generated by Drupal into your secrets/PROJECTNAME_drupal_settings_hash_salt file.
  • Uncomment the bind mounts on the app service and restart the app container so that you don't need to build everytime you modify the code.

Drupal Configuration Export/Import

When exporting and importing Drupal configuration, use the app/src/config_sync directory. If you need to change that, make sure to update app/docker-config/drupal/settings.php.

Composer Commands

You can run Composer commands either using their Docker image, or your local install of Composer.

In both cases, use the --ignore-platform-reqs flag to bypass Composer's checks that your system can run the projects/libraries you are adding or updating. This does mean you need to make sure to adjust the Dockerfile to have those requirements without being prompted by Composer.

Using Composer via their Docker image looks something like:

docker run --rm --user $(id -u):$(id -g) --volume $PWD/tmp/composer_cache:/tmp --volume $PWD/app/src:/app \
      composer require --ignore-platform-reqs --no-interaction --no-ansi drupal/modulename;

Where you set up a directory in tmp/composer_cache to make sure Composer can reuse downloaded files.

Varnish

Varnish 7.2 is installed in the Docker image and s6-overlay starts it alongside Apache 2.4.

Apache is exposed on port 80, Varnish on port 8080.

The dev.run.yml Compose file is pointed at Apache.

About

Waterdrop is a Drupal 10 in Docker quickstart project.

License:MIT License


Languages

Language:Dockerfile 50.2%Language:Shell 34.9%Language:VCL 15.0%