These are a bunch of scripts to help with creating a development environment for Drupal 8 and Docker on Mac OSX.
- Install Docker for Mac
- Install docker-sync -
gem install docker-sync
- in Terminal run
bash init.sh
bash start.sh
- will start containers and docker-sync + your start homepage in browserbash stop.sh
- will stop containers - db does not get removed because it's local -bash restart.sh
- will stop containers and docker-sync and then restart these, no db is lostdocker-compose exec php drush
- drush
-
the scripts will:
- create a directory for database so that if you kill docker you will not lose the db
- downloads Drupal8 latest
- pulls (if needed) and installs all required Docker images
- runs the containers
- performs a wait so that the files will be copied across from volumes
- docker-sync will remain in listen mode and will sync files as they get changed
- opens the start page of the Drupal site
I use Kitematic to investigate containers. If a container fails to run make note of the errors and make sure they are not already running.(this was one of my problems, I forgot it running in a different project and two similar services were not able to run at the same time on same ports).
If you're feeling geeky use these commands to investigate:
docker ps --all
docker images --all
docker exec -it <container name> /bin/bash
- to ssh into a containerdocker4drupal - everything you need to know about what is installed in these containers.