Docker enviroment setting up for Drupal 8 local development
Drupal version: 8.6.12
git clone https://github.com/dalenguyen/drupal8-docker.git
cd drupal8-docker
This command will install Drupal 8.6.12 to drupal/web folder. For Windows user, you can skip this step. Instead, you have download drupal 8 from the main website and put in under drupal/web folder.
sh drupal-install.sh
Manage the containers
docker-compose up -d
docker-compose down
Please update your /etc/hosts in order to visit the site and the dashboard
## Drupal 8 Docker
127.0.0.1 drupal8.localhost:8080
127.0.0.1 portainer.drupal8.localhost:8080
Export database
docker exec drupal8_mysql /usr/bin/mysqldump -u root --password=password drupal > drupal/backup.sql
Import database
cat drupal/backup.sql | docker exec -i drupal8_mysql /usr/bin/mysql -u root --password=password drupal
Remember to change the host name of MySQL is to drupal8_mysql when you install Drupal.