Skip to content

Instantly share code, notes, and snippets.

@justinhough
Created May 10, 2019 16:57
Show Gist options
  • Save justinhough/cc00c34b1e20c99ae9d312579542b0eb to your computer and use it in GitHub Desktop.
Save justinhough/cc00c34b1e20c99ae9d312579542b0eb to your computer and use it in GitHub Desktop.
Setup Drupal with Docksal and Acquia BLT

Setup Drupal with Dockal and Acquia BLT

Disclaimer: After doing some research and digging into issues with the initial setup for Docksal and BLT I have created this walkthrough about to get a Drupal project setup

  1. Create your project by running the following command below. If you run into any errors, such as, Fatal error: Allowed memory size of 1610612736 bytes exhausted then you should proceed to Overriding PHP web settings before proceeding to step 2.

fin run-cli composer create-project --no-interaction acquia/blt-project project-name

cd project-name

The following commands should all be run from within your project root

  1. Initialize your project containers: fin project start

  2. Configure BLT to work with Docksal. Open blt/blt.yml and update/add the following items:

project:
  machine_name: project-name
  local:
    hostname: '${env.VIRTUAL_HOST}'
drupal:
  db:
    database: default
    username: user
    password: user
    host: db
    port: 3306
  1. Since BLT comes with pre-configured settings you will need to delete the following files (they will be auto-generated again later with the proper settings from above).
docroot/sites/default/settings/local.settings.php
docroot/sites/default/local.drush.yml
  1. Add the BLT addon to Docksal so that we can run blt commands. Run fin addon install blt.

  2. Run the following commands:

fin blt blt:init:settings
fin blt drupal:install
  1. Begin development. You can visit your site at http://project-name.docksal.

Overriding PHP web settings

Inside your project root do the following:

  1. Create the following folder structure: .docksal/etc/php/

  2. Add php.ini inside the php folder. (The CLI will be looking in this directory for PHP settings). Add the following contents to the file.

; PHP settings
[php]
; Maximum amount of memory a script may consume
memory_limit = 1024M
max_input_vars = 1000
  1. Run fin restart cli

  2. Run composer install to complete the create project build steps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment