Skip to content

Instantly share code, notes, and snippets.

@achraf-jeday
Last active January 8, 2020 10:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achraf-jeday/6b1ae4fe02d9a58314458d6585cf920f to your computer and use it in GitHub Desktop.
Save achraf-jeday/6b1ae4fe02d9a58314458d6585cf920f to your computer and use it in GitHub Desktop.
We are going to use composer to create a codebase with the latest version of Drupal 8.
We are going to use composer to create a codebase with the latest version of Drupal 8 or 7:
Drupal 8:
composer create-project drupal-composer/drupal-project:8.x-dev docker_drupal --stability dev --no-interaction
Drupal 7:
composer create-project drupal-composer/drupal-project:7.x-dev docker_drupal --no-interaction
Then we are going to clone the latest version of docker4drupal and remove the .git folder from it:
git clone git@github.com:wodby/docker4drupal.git docker_drupal_server
rm -R docker_drupal_server/.git
Or
sudo rm -R docker_drupal_server/.git
Then we are going to remove the docker-compose.override.yml which will tell docker4drupal to check for a web folder and load the Drupal codebase from there:
rm docker_drupal_server/docker-compose.override.yml
Or
sudo rm docker_drupal_server/docker-compose.override.yml
And copy the content of the server folder's content to the Drupal composer folder:
cp -R docker_drupal_server docker_drupal
Or
cp -a docker_drupal_server/. docker_drupal/
Optional: for Drupal 7 or 6 comment out corresponding DRUPAL_TAG and NGINX_VHOST_PRESET in .env file
Afterward, we are going to change to the docker_drupal folder and use docker compose to run the containers:
docker-compose up -d
And the Drupal install interface should appear under:
http://drupal.docker.localhost:8000
----------
drupal-composer:
https://github.com/drupal-composer/drupal-project
docker4drupal:
https://github.com/wodby/docker4drupal
More videos and stuff you may find on https://drupal-up.com
Credits: https://www.youtube.com/watch?v=aYb8C18HjmY&t=94s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment