Using Composer to install Drupal 8 & Commerce on Docker local environment with amazee.io
28 February 2017
- 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-SITE
up in the folder above, then deletedMY-SITE
. - Edit
docker-compose.yml
and 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)
- Edit
.amazeeio.yml
and 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)
- Run
drush si
to install drupal and create a database - Open your local site in the browser (type
url
to 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’;`
- Run
drush cex
to import your initial config, then commit your changes - Configure all standard site settings
- Run
drush cex
again, then commit your changes - Enable the Commerce modules by going to
admin/modules
, typingcommerce
and ticking the relevant checkboxes
- Continue configuring commerce using the official Commerce 2.x documentation
- Launch your site and make your clients very happy!
Topics