Add Drupal headless stack with Next.js frontend
- Add Next.js frontend service (nextjs) with Dockerfile and source - Update docker-compose.yml: image names, Drupal 11.3.3, nextjs service - Add docker-compose.override.yml.disabled for dev hot-reload - Add install-headless-modules.sh for OAuth/JSON:API module setup - Add README.md with full setup and configuration guide - Update nginx/Dockerfile and nginx.conf.template for cms. subdomain - Update drupal/Dockerfile PHP-FPM build args - Gitignore **/.vscode/ to prevent IDE workspace files from being tracked
This commit is contained in:
parent
71a8dac389
commit
f8b8f53d54
85 changed files with 7802 additions and 17 deletions
65
drupal/install-headless-modules.sh
Executable file
65
drupal/install-headless-modules.sh
Executable file
|
|
@ -0,0 +1,65 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "Installing Headless Drupal modules..."
|
||||
|
||||
# Check if aliases are available.
|
||||
if command -v dcomposer &> /dev/null; then
|
||||
COMPOSER_CMD="dcomposer"
|
||||
DRUSH_CMD="ddrush"
|
||||
else
|
||||
COMPOSER_CMD="docker exec drupal-fpm composer"
|
||||
DRUSH_CMD="docker exec drupal-fpm drush"
|
||||
fi
|
||||
|
||||
# Core headless modules.
|
||||
echo "→ Installing core headless modules..."
|
||||
$COMPOSER_CMD require \
|
||||
drupal/next \
|
||||
drupal/jsonapi_extras \
|
||||
drupal/simple_oauth \
|
||||
drupal/pathauto \
|
||||
|
||||
# Additional JSON:API enhancements.
|
||||
echo "→ Installing JSON:API enhancement modules..."
|
||||
$COMPOSER_CMD require \
|
||||
drupal/subrequests \
|
||||
drupal/decoupled_router \
|
||||
drupal/consumers \
|
||||
drupal/jsonapi_menu_items \
|
||||
drupal/jsonapi_include \
|
||||
drupal/jsonapi_resources \
|
||||
drupal/jsonapi_menu_items
|
||||
|
||||
# Content and media.
|
||||
echo "→ Installing content and media modules..."
|
||||
$COMPOSER_CMD require \
|
||||
drupal/metatag \
|
||||
drupal/redirect \
|
||||
drupal/field_group
|
||||
|
||||
# Performance and caching.
|
||||
echo "→ Installing performance modules..."
|
||||
$COMPOSER_CMD require \
|
||||
drupal/redis
|
||||
|
||||
# Development tools.
|
||||
echo "→ Installing development tools..."
|
||||
$COMPOSER_CMD require --dev \
|
||||
drupal/coder \
|
||||
drupal/devel \
|
||||
drupal/restui \
|
||||
drupal/admin_toolbar
|
||||
|
||||
# "Advanced" modules.
|
||||
echo "→ Installing advanced modules..."
|
||||
$COMPOSER_CMD require \
|
||||
drupal/pathauto
|
||||
|
||||
echo "✓ All modules installed successfully!"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo "1. Enable modules: $DRUSH_CMD en next jsonapi_extras simple_oauth pathauto -y"
|
||||
echo "2. Generate OAuth keys: docker exec drupal-fpm bash -c 'cd /opt/drupal && mkdir -p oauth/keys && openssl genrsa -out oauth/keys/private.key 2048 && openssl rsa -in oauth/keys/private.key -pubout -out oauth/keys/public.key && chmod 600 oauth/keys/*.key'"
|
||||
echo "3. Configure modules via Drupal admin UI"
|
||||
echo "4. Export configuration: $DRUSH_CMD cex -y"
|
||||
Loading…
Add table
Add a link
Reference in a new issue