

DRUPAL CONTAINERS INSTALL
sh file looks like this: #!/bin/shĪnd then add the following to your Dockerfile to include and run this file during build time, so our full Dockerfile looks like this: FROM drupal:8.7.5-apacheĪt this point if we were to build our Docker image we would have Drupal core ready to be installed and Composer available to install packages and modules. To simplify the install process I’ve included the instructions in a composer.sh file that can be copied and run during Docker image build time, just ensure the composer.sh file is in the same directory as the Dockerfile. phar file, and then copy to your system path.

DRUPAL CONTAINERS DOWNLOAD
The process for installing Composer is fairly straightforward, you use PHP to download a. Now that we have our base Drupal core in an extendable image, next we are going to install Composer. Next we’ll build our Dockerfile to add more goodies to this image.Ĭreate a new Dockerfile and use our new Drupal image drupal:8.7.5-apache in the FROM instruction: FROM drupal:8.7.5-apache This will be our starting point image as the Drupal team has done a good job keeping these images up to date on Docker Hub. I’m going to use the latest version of Drupal with the 8.7.5-apache tag to keep my version of Drupal consistant and to get the Apache version: Extending the Drupal Imageįirst, download the official Drupal container from Docker Hub. I’ll assume you have Docker installed are comfortable with creating new images with Dockerfiles and can launch images with Docker Compose. By extending the prebuilt Docker Hub Drupal we can start with a clean Drupal core, then extend to install Composer and Drush, install XDEBUG, and finally launch our container using Docker Compose. If you wish to have a pristine docker environment you may execute the following commands.In this article I’m going to show how I setup a local Docker container running Drupal core to work on modules and other Drupal development tasks. docker/bin/drush migrate:import -group gcweb -tag 'Menu' Cleanup # Bring up the dev stack docker compose -f build -no-cacheĭocker compose -f up -d # Mutagen Setup export VOLUME =site-wxt-mutagen-cacheĭocker volume create $VOLUME docker container create -name $VOLUME -v $VOLUME:/volumes/ $VOLUME mutagenio/sidecar:0.13.0-beta3ĭocker start $VOLUME mutagen sync create -name $VOLUME -sync-mode =two-way-resolved -default-file-mode-beta 0666 -default-directory-mode-beta 0777 $( pwd ) docker:// $VOLUME/volumes/ $VOLUME # Create symlinks ln -s docker/ While this is fixed with the new virtualization framework discussed above.įor older environments mutagen will have to be used instead and as such requires a few additional steps. If you have Docker for Desktop and a new enough OSX environment (Monterey or higher) then the steps are the exact same as those for the Linux environment given above.Īll that is required in advance is to enable VirtioFS accelerated directory sharing which you can see in the attached picture below.įor older environments you may still use mutagen which is discussed below. docker/bin/drush migrate:import -group gcweb -tag 'Menu' Modern OSX Environments docker/bin/drush migrate:import -group gcweb -tag 'Core' & \ docker/bin/drush migrate:import -group wxt -tag 'Core' & \ docker/bin/drush config-set wxt_ttings wxt.theme theme-gcweb -y & \ docker/bin/drush php-eval 'node_access_rebuild() ' & \ docker/bin/drush config-set system.performance css.preprocess 0 -y & \ docker/bin/drush config-set system.performance js.preprocess 0 -y & \ # Bring up the dev stack docker compose -f docker-compose.yml build -no-cacheĭocker compose -f docker-compose.yml up -d # Composer install export COMPOSER_MEMORY_LIMIT =-1 & composer install
