version: '3.7' services: ## # The WP CLI container. ## cli: image: wordpressdevelop/cli:${LOCAL_PHP-latest} networks: - wpdevnet environment: LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false} volumes: - ../../:/var/www # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly. init: true ## # The PHPUnit container. ## phpunit: image: wordpressdevelop/phpunit:${LOCAL_PHP-latest} networks: - wpdevnet environment: LOCAL_PHP_XDEBUG: ${LOCAL_PHP_XDEBUG-false} volumes: - ./phpunit-config.ini:/usr/local/etc/php/conf.d/phpunit-config.ini - ../../:/wordpress-develop - phpunit-uploads:/wordpress-develop/${LOCAL_DIR-src}/wp-content/uploads # The init directive ensures the command runs with a PID > 1, so Ctrl+C works correctly. init: true depends_on: - mysql volumes: # Using a volume for the uploads directory improves PHPUnit performance. phpunit-uploads: {}