Skip to content

dgading/drupal_compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drupal Compose

A simple Drupal Docker setup

Required

Docker MAC | Windows

Installing the Environment

  1. Git clone the repo. I recommend using git clone [email protected]:dgading/drupal_compose.git project-name to keep your evironments separate.
  2. In terminal open the new directory.
  3. Run docker-compose build to build the server container. It is a PHP 7.1 Apache build. This is based on the Drupal Composer project and all Core and Contrib modules added in the composer.json file will be installed in this step.
  4. Run docker-compose up to see all processes as they run or docker-compose up -d to run the containers in the background.
  5. In your browser, open the default server at http://localhost:9000.
  6. Start the Drupal installation process. The default settings are:
    1. MySql name: root
    2. MySql user: root
    3. MySql password: example
    4. In advanced dropdown, change localhost to mysql
  7. Continue with installation as normal

Using the Environment

Logging into the docker container

  1. Run docker ps.
  2. Copy the Container ID of the php contianer (it will be named something like drupalcompose_php).
  3. Run docker exec -it <container id> bash.
  4. This will open the container at /www/var/html.

Using Drush

Drush is setup to run in the Docker environment and not from your local machine. Drush is available from within the web directory in the PHP container.

Using Composer

All modules and patches should be added through composer require or composer install.

Theming

All custom module and themes should be worked on locally and their volumes will be synced with the Docker environments.

Using MySQL

Using a tool like Sequel Pro add the following connection details to the Standard tab.

  1. Host => localhost or 127.0.0.1
  2. Username => root
  3. Password => example
  4. Port => 3306 or whatever you have on line 15 in docker-compose.yml

If you want command line access:

  1. Find the mysql container with docker ps.
  2. Log into the container using docker exec -it <container id> bash
  3. Once in the container, run mysql -u root -p
  4. If you are still using the defaults, enter example at the prompt and start mysqling.

About

A test Drupal Docker Compose setup

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages