Experiments in Assets, and bootstrapping Drupal #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Basically, this PR started as an approach to using an "assets" image for storing local state (drupal add-ons and config, mysql dbs, solr, etc). These experiments revealed a flaw in the recommended approach to "volumizing" local content in Drupal. I observed:
/var/www/html/{modules,profiles,sites,themes}
/var/www/html/sites
, which using an assets image provides./var/www/html/sites
./var/www/html/sites
is a mounted volumetar -tf build/assets/data/assets.tar.gz
. This is the most basic assets content that makes "an empty Drupal work".docker-compose up -d
./var/www/html/{modules,profiles,sites,themes}
. In fact, it looks like anything under/var/www/html
is fair game for installation or modification using composer. Thus, I believe/var/www/html
itself has to be a mounted volume, as it's all local state/var/www/html
, including Drupal itselfTry it out
This will illustrate the issues above. Check out this PR, and do the following:
docker-compose.exe -f docker-compose.mvp1.yml build
docker-compose.exe -f docker-compose.mvp1.yml up -d
sites
content in a volume, provided by the assets image. Hop into that container to verifydocker exec -it isle-dc-drupal-idcp bash
ls -l /var/www/html/sites
, you'll see it's a symlink:/var/www/html/sites -> /mnt/assets/sites
/mnt/assets
. This is where the Drupal assets are mounted.ls -l /var/www/html/sites/
(note trailing slash). You can see the site files provided by the assets image.docker exec -i isle-dc-assets-idcp bootstrap.sh
. It'll take a couple minutes to finishhttp://localhost:8080
. Log in asadmin:islandora
if you want.docker diff isle-dc-drupal-idcp | grep /var/www/html
D'OH!docker exec -i isle-dc-assets-idcp dump.sh
build/assets/data/assets.tar.gz
file in your locak directory. It has a lot more in it, doesn't it