Minimal Drupal 7.x development environment stack.
How to use:
-
Place a copy of this docker-compose.yml file at your Drupal site root or maybe create a folder "docker/".
-
Build the image using 'docker build -t your_image_name .'
-
Start the web stack: 'docker-compose up -d'
-
To see your running containers: docker ps
-
To get inside the container using bash: 'docker-compose exec web bash'
-
For new installation:
Add Database setup instructions while installing Drupal:
- Database name = 'your_db_name'
- Database username = 'root'
- Leave database password blank
- Expand "Advanced options" and set Database host = 'db' (This is defined in docker-compose.yml file)
-
For existing installation:
Import Database using:
docker exec -i your_db_container mysql -uroot -proot your_db_name < filename.sql -
Make necessary changes in settings.php
-
Run Drush commands with:
- USER_ID=$(id -u) docker-compose run --rm drush $rest_of_the_command