# Local Drupal 11 for developing aivis_os. Not shipped; see scripts/README.md.
# The base image pins an older 11.x; core is raised to the latest 11.4 release so
# the dev site is not built on a version with open security advisories.
FROM drupal:11-php8.3-apache
WORKDIR /opt/drupal
ENV COMPOSER_ALLOW_SUPERUSER=1 COMPOSER_NO_INTERACTION=1
RUN apt-get update && apt-get install -y --no-install-recommends sqlite3 unzip git && rm -rf /var/lib/apt/lists/*
RUN composer config --no-plugins allow-plugins.symfony/runtime true \
 && composer config --no-plugins allow-plugins.tbachert/spi false \
 && composer config --no-plugins allow-plugins.php-http/discovery true \
 && composer config --no-plugins allow-plugins.phpstan/extension-installer true \
 && composer config --no-plugins allow-plugins.dealerdirect/phpcodesniffer-composer-installer true \
 && composer require -W "drupal/core-recommended:^11.4" "drupal/core-composer-scaffold:^11.4" \
      "drupal/core-project-message:^11.4" drush/drush \
 && CORE="$(composer show drupal/core --format=json | php -r 'echo json_decode(stream_get_contents(STDIN))->versions[0];')" \
 && composer require --dev -W "drupal/core-dev:${CORE}" \
 && mkdir -p web/modules/contrib web/sites/default/files /opt/drupal/private \
 && chown -R www-data:www-data web/sites /opt/drupal/private
