Config
DDEV Configuration for Skpr projects
Configuration can be found below and is only recommended as a suggestion - there may be more specific details for your application - for example the application name, and the PHP version will need to change or be updated over time.
Development dependencies
In order to get testing working with the use of PHPUnit, run the following command to install Selenium to DDEV.
ddev get ddev/ddev-selenium-standalone-chrome
DDEV Configuration
The following configuration must be found in .ddev/config.yaml
:
Metadata
name: my_project
type: drupal10
docroot: app
Service configuration
php_version: "8.2"
webserver_type: nginx-fpm
xdebug_enabled: false
use_dns_when_possible: true
composer_version: "2"
Custom config
omit_containers: [db]
disable_settings_management: true
web_environment:
Variables configuring Drush Options
- DRUSH_OPTIONS_ROOT=/var/www/html/app
- DRUSH_OPTIONS_URI=${DDEV_PRIMARY_URL}
Variables for XDEBUG Configuration
- PHP_IDE_CONFIG=serverName=${DDEV_SITENAME}
Variables configuring testing
- BROWSERTEST_OUTPUT_BASE_URL=${DDEV_PRIMARY_URL}
- SIMPLETEST_BASE_URL=${DDEV_PRIMARY_URL}
- SIMPLETEST_DB=mysql://local:local@local/database
- MINK_DRIVER_ARGS_WEBDRIVER=[\"chrome\", {\"browserName\":\"chrome\",\"chromeOptions\":{\"w3c\":false,\"args\":[\"--disable-gpu\",\"--headless\", \"--no-sandbox\", \"--disable-dev-shm-usage\"]}}, \"http://selenium-chrome:4444/wd/hub\"]
Variables configuring Drupal Test Traits
- DTT_BASE_URL=${DDEV_PRIMARY_URL}
- DTT_SCREENSHOT_REPORT_DIRECTORY=/var/www/html/app/sites/simpletest/screenshots
- DTT_MINK_DRIVER_ARGS=[\"chrome\", {\"browserName\":\"chrome\",\"chromeOptions\":{\"w3c\":false,\"args\":[\"--disable-gpu\",\"--headless\", \"--no-sandbox\", \"--disable-dev-shm-usage\"]}}, \"http://selenium-chrome:4444/wd/hub\"]
Database configuration
Our database is provided via our official database images. In order to do this using DDEV, we need to provide a custom
docker-compose.yaml
file which will be aggregated and linked up to the web
service automatically. You simply need to
copy the database image reference from the docker-compose.yml
file in your projects root to this file.
This needs to be written to .ddev/docker-compose.database.yaml
version: '3.6'
services:
database:
container_name: ddev-${DDEV_SITENAME}-database
image: DATABASE_IMAGE
ports:
- 3206:3306
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
web:
links:
- database:database