This project is an extension of drupal-composer/drupal-project with the additional components of a ready to use Docker development environment and some preset configuration.
To use this project you can use composer create-project
In this step we'll check out the Drupal site template into a folder, we'll install all the utility tools like Drush and Drupal Console, set some default settings and use some best practice in regards to configuration location.
If you have composer and PHP installed on you development host this step is the easiest. Simply run
composer create-project --repository="{\"url\": \"git@github.com:education-nz/drupal-project.git\", \"type\": \"vcs\"}" --stability=dev --remove-vcs education-nz/drupal-project:8.x-dev [PROJECT_NAME]
Replace [PROJECT_NAME]
with the actual name of your project.
If you don't have composer and PHP installed and you prefer to keep a clean host machine. The following uses a composer/php Docker image to install the template.
docker run --rm -it --volume ${COMPOSER_HOME:-$HOME/.composer}:/tmp --volume $(pwd):/app prooph/composer:7.3 create-project --repository="{\"url\": \"git@github.com:education-nz/drupal-project.git\", \"type\": \"vcs\"}" --stability=dev --remove-vcs education-nz/drupal-project:8.x-dev [PROJECT_NAME]
Fix permissions
chown -R `whoami`.`whoami` [PROJECT_NAME]`
cp .env.example .env
Al that's needed for development is to set the PROJECT_NAME
variable.
Do this in the .env
file.
docker-compose up -d
docker exec -it [PROJECT_NAME]-apache vendor/bin/drush -y site:install --site-name="My site name" --account-name=admin --account-pass="a complex password"
Now you can add the project to VCS. Go to http://localhost:8080 to see your new site.