Skip to content

Commit

Permalink
Merge pull request #9 from wardenenv/pending-merge/drupal
Browse files Browse the repository at this point in the history
Add description of and setup instructions for the new Drupal environment
  • Loading branch information
navarr authored Apr 24, 2023
2 parents 65951de + 3b4182f commit 2c3f17d
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 17 deletions.
82 changes: 82 additions & 0 deletions environments/drupal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Installing Drupal

The below example demonstrates the from-scratch setup of a Drupal application for local development. A similar process can easily be used to configure an environment of any other type. This assumes that Warden has been previously started via `warden svc up` as part of the installation procedure.

1. Create a new directory on your host machine at the location of your choice and then jump into the new directory to get started:

mkdir -p ~/Sites/exampleproject
cd ~/Sites/exampleproject

2. From the root of your new project directory, run `env-init` to create the `.env` file with configuration needed for Warden and Docker to work with the project.

warden env-init exampleproject drupal

The result of this command is a `.env` file in the project root (tip: commit this to your VCS to share the configuration with other team members) having the following contents:

WARDEN_ENV_NAME=exampleproject
WARDEN_ENV_TYPE=drupal

WARDEN_WEB_ROOT=/

TRAEFIK_DOMAIN=tdpl.test
TRAEFIK_SUBDOMAIN=app
DB_DISTRIBUTION=mariadb
DB_DISTRIBUTION_VERSION=10.4
NODE_VERSION=18
COMPOSER_VERSION=2
PHP_VERSION=8.2
PHP_XDEBUG_3=1

WARDEN_DB=1
WARDEN_RABBITMQ=0
WARDEN_REDIS=0

RABBITMQ_VERSION=3.8

WARDEN_SYNC_IGNORE=

WARDEN_ALLURE=0
WARDEN_SELENIUM=0
WARDEN_SELENIUM_DEBUG=0
WARDEN_BLACKFIRE=0

BLACKFIRE_CLIENT_ID=
BLACKFIRE_CLIENT_TOKEN=
BLACKFIRE_SERVER_ID=
BLACKFIRE_SERVER_TOKEN=

3. Sign an SSL certificate for use with the project (the input here should match the value of `TRAEFIK_DOMAIN` in the above `.env` example file):

warden sign-certificate exampleproject.test

4. Next you'll want to start the project environment:

warden env up

:::{warning}
If you encounter an error about ``Mounts denied``, follow the instructions in the error message and run ``warden env up`` again.
:::

5. Drop into a shell within the project environment. Commands following this step in the setup procedure will be run from within the `php-fpm` docker container this launches you into:

warden shell

6. Initialize project source files using composer create-project and then move them into place:

composer create-project drupal/recommended-project /tmp/exampleproject

rsync -a /tmp/exampleproject/ /var/www/html/
rm -rf /tmp/exampleproject/

7. Launch the Installation Wizard in your browser and follow the instructions:

The new application will be at https://app.exampleproject.test/ (or app.what-you-called-your-project.test).

The SQL Credentials that need to be configured are "db" as the host, and "drupal" as the username, password, and database.

![Screenshot of Database Configuration page as described above](drupal/setup.png)

:::{note}
To completely destroy the ``exampleproject`` environment we just created, run ``warden env down -v`` to tear down the project's Docker containers, volumes, etc.
:::

Binary file added environments/drupal/setup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 27 additions & 17 deletions environments/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,27 @@ When this type is used, a `.warden/warden-env.yml` may be placed in the root dir

Similar to the other environment type's base definitions, Warden supports a `warden-env.darwin.yml` and `warden-env.linux.yml`

## Drupal

The `drupal` environment type supports development of Drupal projects, launching containers including:

* Nginx
* PHP-FPM
* MariaDB

In order to achieve a well performing experience on macOS, files in the webroot are synced into the container using a Mutagen sync session with the exception of `web/sites/default/files` and `web/sites/default/private` which remain mounted using a delegated mount.

## Laravel

The `laravel` environment type supports development of Laravel projects, launching containers including:

* Nginx
* PHP-FPM
* MariaDB
* Redis

Files are currently mounted using a delegated mount on macOS and natively on Linux.

## Magento 2

The `magento2` environment type provides necessary containerized services for running Magento 2 in a local development context including:
Expand All @@ -35,20 +56,9 @@ The `magento1` environment type supports development of Magento 1 projects, laun

Files are currently mounted using a delegated mount on macOS and natively on Linux.

## Laravel

The `laravel` environment type supports development of Laravel projects, launching containers including:

* Nginx
* PHP-FPM
* MariaDB
* Redis

Files are currently mounted using a delegated mount on macOS and natively on Linux.

## Symfony
## Shopware

The `symfony` environment type supports development of Symfony 4+ projects, launching containers including:
The `shopware` environment type supports development of Shopware 6 projects, launching containers including:

* Nginx
* PHP-FPM
Expand All @@ -58,11 +68,11 @@ The `symfony` environment type supports development of Symfony 4+ projects, laun
* Varnish (disabled by default)
* Elasticsearch (disabled by default)

Files are currently mounted using a delegated mount on macOS and natively on Linux.
In order to achieve a well performing experience on macOS, files in the webroot are synced into the container using a Mutagen sync session with the exception of `public/media` which remains mounted using a delegated mount.

## Shopware
## Symfony

The `shopware` environment type supports development of Shopware 6 projects, launching containers including:
The `symfony` environment type supports development of Symfony 4+ projects, launching containers including:

* Nginx
* PHP-FPM
Expand All @@ -72,7 +82,7 @@ The `shopware` environment type supports development of Shopware 6 projects, lau
* Varnish (disabled by default)
* Elasticsearch (disabled by default)

In order to achieve a well performing experience on macOS, files in the webroot are synced into the container using a Mutagen sync session with the exception of `public/media` which remains mounted using a delegated mount.
Files are currently mounted using a delegated mount on macOS and natively on Linux.

## WordPress

Expand Down

0 comments on commit 2c3f17d

Please sign in to comment.