Skip to content

Commit 2c3f17d

Browse files
authored
Merge pull request #9 from wardenenv/pending-merge/drupal
Add description of and setup instructions for the new Drupal environment
2 parents 65951de + 3b4182f commit 2c3f17d

File tree

3 files changed

+109
-17
lines changed

3 files changed

+109
-17
lines changed

environments/drupal.md

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Installing Drupal
2+
3+
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.
4+
5+
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:
6+
7+
mkdir -p ~/Sites/exampleproject
8+
cd ~/Sites/exampleproject
9+
10+
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.
11+
12+
warden env-init exampleproject drupal
13+
14+
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:
15+
16+
WARDEN_ENV_NAME=exampleproject
17+
WARDEN_ENV_TYPE=drupal
18+
19+
WARDEN_WEB_ROOT=/
20+
21+
TRAEFIK_DOMAIN=tdpl.test
22+
TRAEFIK_SUBDOMAIN=app
23+
DB_DISTRIBUTION=mariadb
24+
DB_DISTRIBUTION_VERSION=10.4
25+
NODE_VERSION=18
26+
COMPOSER_VERSION=2
27+
PHP_VERSION=8.2
28+
PHP_XDEBUG_3=1
29+
30+
WARDEN_DB=1
31+
WARDEN_RABBITMQ=0
32+
WARDEN_REDIS=0
33+
34+
RABBITMQ_VERSION=3.8
35+
36+
WARDEN_SYNC_IGNORE=
37+
38+
WARDEN_ALLURE=0
39+
WARDEN_SELENIUM=0
40+
WARDEN_SELENIUM_DEBUG=0
41+
WARDEN_BLACKFIRE=0
42+
43+
BLACKFIRE_CLIENT_ID=
44+
BLACKFIRE_CLIENT_TOKEN=
45+
BLACKFIRE_SERVER_ID=
46+
BLACKFIRE_SERVER_TOKEN=
47+
48+
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):
49+
50+
warden sign-certificate exampleproject.test
51+
52+
4. Next you'll want to start the project environment:
53+
54+
warden env up
55+
56+
:::{warning}
57+
If you encounter an error about ``Mounts denied``, follow the instructions in the error message and run ``warden env up`` again.
58+
:::
59+
60+
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:
61+
62+
warden shell
63+
64+
6. Initialize project source files using composer create-project and then move them into place:
65+
66+
composer create-project drupal/recommended-project /tmp/exampleproject
67+
68+
rsync -a /tmp/exampleproject/ /var/www/html/
69+
rm -rf /tmp/exampleproject/
70+
71+
7. Launch the Installation Wizard in your browser and follow the instructions:
72+
73+
The new application will be at https://app.exampleproject.test/ (or app.what-you-called-your-project.test).
74+
75+
The SQL Credentials that need to be configured are "db" as the host, and "drupal" as the username, password, and database.
76+
77+
![Screenshot of Database Configuration page as described above](drupal/setup.png)
78+
79+
:::{note}
80+
To completely destroy the ``exampleproject`` environment we just created, run ``warden env down -v`` to tear down the project's Docker containers, volumes, etc.
81+
:::
82+

environments/drupal/setup.png

98.7 KB
Loading

environments/types.md

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,27 @@ When this type is used, a `.warden/warden-env.yml` may be placed in the root dir
1010

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

13+
## Drupal
14+
15+
The `drupal` environment type supports development of Drupal projects, launching containers including:
16+
17+
* Nginx
18+
* PHP-FPM
19+
* MariaDB
20+
21+
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.
22+
23+
## Laravel
24+
25+
The `laravel` environment type supports development of Laravel projects, launching containers including:
26+
27+
* Nginx
28+
* PHP-FPM
29+
* MariaDB
30+
* Redis
31+
32+
Files are currently mounted using a delegated mount on macOS and natively on Linux.
33+
1334
## Magento 2
1435

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

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

38-
## Laravel
39-
40-
The `laravel` environment type supports development of Laravel projects, launching containers including:
41-
42-
* Nginx
43-
* PHP-FPM
44-
* MariaDB
45-
* Redis
46-
47-
Files are currently mounted using a delegated mount on macOS and natively on Linux.
48-
49-
## Symfony
59+
## Shopware
5060

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

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

61-
Files are currently mounted using a delegated mount on macOS and natively on Linux.
71+
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.
6272

63-
## Shopware
73+
## Symfony
6474

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

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

75-
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.
85+
Files are currently mounted using a delegated mount on macOS and natively on Linux.
7686

7787
## WordPress
7888

0 commit comments

Comments
 (0)