Using Composer to install Drupal 8 & Commerce on Docker local environment with amazee.io
- Create a new repository in GitHub, GitLab or BitBucket (or equivalent) for your project and clone it locally.
- `cd` into your site directory, then `git checkout -b dev` to create the dev branch.
- Run composer project creation to create an install of Drupal 8, but with customisations to make it work nicely with amazee.io
composer create-project amazeeio/drupal-project:8.x-dev MY-SITE --stability dev --no-interaction
- move the files in the folder
MY-SITEup in the folder above, then deleted
docker-compose.ymland include your hostname (if you are have been given one, if not request it from the team or add this later when you’re ready to go live)
.amazeeio.ymland include your sitegroup (if you are have been given one, if not request it from the team or add this later when you’re ready to go live)
- Add the Drupal Packagist repository to allow Composer to find Commerce and the other Drupal modules
composer config repositories.drupal composer https://packages.drupal.org/8
- Run amazee docker locally (cachalot / pygmy)
drush sito install drupal and create a database
- Open your local site in the browser (type
urlto find out what it is)
- edit `settings.php` to include the following line at the bottom, this will change your config sync folder to the site docroot instead of sites/default/config `$config_directories[CONFIG_SYNC_DIRECTORY] = ‘../config/sync’;`
drush cexto import your initial config, then commit your changes
- Configure all standard site settings
drush cexagain, then commit your changes
- Enable the Commerce modules by going to
commerceand ticking the relevant checkboxes
- Continue configuring commerce using the official Commerce 2.x documentation
- Launch your site and make your clients very happy!