It uses the Composer template.
First you need to install composer.
Note: The instructions below refer to the global composer installation. You might need to replace
composer
withphp composer.phar
(or similar) for your setup.
After that you can create the project:
composer create-project drupal-composer/drupal-project:8.x-dev some-dir --stability dev --no-interaction
With composer require ...
you can download new dependencies to your installation.
cd some-dir
composer require drupal/devel:8.*
Copy the .gitignore.
Copy and adapt the docker-compose.yml in your project.
Copy the nginx configuration in docker/nginx
.
Make an html
link to the web folder :
ln -s web html
Start the servers:
docker-compose up
- Varnish is on localhost:8017
- Nginx is on localhost:8016
- Adminer is on localhost:8015
To run drush
commands use:
docker-compose run --rm drush <CMD>
The drush
container is linked with nginx and mysql already.
When installing the given composer.json
some tasks are taken care of:
- Drupal will be installed in the
web
-directory. - Autoloader is implemented to use the generated composer autoloader in
vendor/autoload.php
, instead of the one provided by Drupal (web/vendor/autoload.php
). - Modules (packages of type
drupal-module
) will be placed inweb/modules/contrib/
- Theme (packages of type
drupal-module
) will be placed inweb/themes/contrib/
- Profiles (packages of type
drupal-profile
) will be placed inweb/profiles/contrib/
- Creates default writable versions of
settings.php
andservices.yml
. - Creates
sites/default/files
-directory. - Latest version of drush is installed locally for use at
vendor/bin/drush
.
With using the "Composer Generate" drush extension
you can now generate a basic composer.json
file from an existing project. Note
that the generated composer.json
might differ from this project's file.
Composer recommends no. They provide argumentation against but also workrounds if a project decides to do it anyway.