public function setupDrupalInstall($localhost = false)
    {
        $this->say('Waiting on Drupal database to become available...');

        $database = $this->getDatabaseInfo();

        $engine = $this->getEngineInstance();
        $install_path = $this->getInstallPath();

        if ($engine instanceof DockerEngineType && !$localhost) {
            $drush = $this->drushInstallCommonStack(
                '/var/www/html/vendor/bin/drush',
                '/var/www/html' . static::installRoot(),
                $database
            );
            $result = $engine->execRaw(
                $drush->getCommand(),
                $this->getPhpServiceName()
            );
        } else {
            // Run the drupal installation from the host machine. The host will
            // need to have the database client binaries installed.
            $database->setHostname('127.0.0.1');

            if (!$this->hasDatabaseConnection($database->getHostname(), $database->getPort())) {
                throw new \Exception(
                    sprintf('Unable to connection to Drupal database %s', $database->getHostname())
                );
            }
            // Sometimes it takes awhile after the mysql host is up on the
            // network to become totally available to except connections. Due to
            // the uncertainty we'll need to sleep for about 30 seconds.
            sleep(30);

            $result = $this->drushInstallCommonStack(
                'drush',
                $install_path,
                $database
            )->run();
        }
        $this->validateTaskResult($result);

        // Update permissions to ensure all files can be accessed on the install
        // path for both user and groups.
        $this->_chmod($install_path, 0775, 0000, true);

        return $this;
    }