renewed way of install drupal and mount volumes

This commit is contained in:
Robert Nasarek 2023-05-11 13:55:07 +02:00
parent 99e2863817
commit 53b6f493db
15 changed files with 1139 additions and 59 deletions

77
drupal_context/entrypoint.sh Executable file
View file

@ -0,0 +1,77 @@
#!/bin/sh
# Entrypoint to install Drupal in container
# Check if installation already exists
if ! [ -d /opt/drupal/web ]
then
# https://www.drupal.org/node/3060/release
DRUPAL_VERSION='10.0.9'
# Installed Drupal modules, please check and update versions if necessary
# List Requirements
REQUIREMENTS="drupal/colorbox \
drupal/conditional_fields:4.x-dev@dev \
drupal/devel \
drush/drush \
drupal/facets \
drupal/field_permissions \
drupal/geofield \
drupal/geofield_map \
drupal/image_effects \
drupal/imagemagick \
drupal/imce \
drupal/inline_entity_form:^1.0@RC \
kint-php/kint \
drupal/leaflet \
drupal/search_api \
drupal/search_api_solr \
drupal/viewfield:^3.0@beta \
drupal/wisski:3.x-dev@dev"
# Install Drupal, WissKI and dependencies
set -eux
export COMPOSER_HOME="$(mktemp -d)"
composer create-project --no-interaction "drupal/recommended-project:$DRUPAL_VERSION" ./
yes | composer require ${REQUIREMENTS}
# delete composer cache
rm -rf "$COMPOSER_HOME"
# install libraries
set -eux
mkdir -p web/libraries
wget https://github.com/jackmoore/colorbox/archive/refs/heads/master.zip -P web/libraries/
unzip web/libraries/master.zip -d web/libraries/
rm -r web/libraries/master.zip
mv web/libraries/colorbox-master web/libraries/colorbox
# IIPMooViewer
wget https://github.com/ruven/iipmooviewer/archive/refs/heads/master.zip -P web/libraries/
unzip web/libraries/master.zip -d web/libraries/
rm -r web/libraries/master.zip
mv web/libraries/iipmooviewer-master web/libraries/iipmooviewer
# Mirador
wget https://github.com/rnsrk/wisski-mirador-integration/archive/refs/heads/main.zip -P web/libraries/
unzip web/libraries/main.zip -d web/libraries/
mv web/libraries/wisski-mirador-integration-main web/libraries/wisski-mirador-integration
# Move settings-file to the right place
mv /settings.php web/sites/default/settings.php
# Set permissions
chmod -R 644 web/sites/default/settings.php
chown -R www-data:www-data /opt/drupal
else
echo "/opt/drupal/web already exists."
fi
# Adjust permissions and links
rm -r /var/www/html
ln -sf /opt/drupal/web /var/www/html
# Start fpm
php-fpm