getDataDirectory() . '/docker-compose.yaml', $config); } /** * @throws \Exception */ public function build(InputInterface $input): DockerComposeFileBuilder { $this->content = $this->config->getConfigFileContents('php.yaml'); if ($this->config->isDatabaseEnabled($input) && in_array($this->config->getDatabaseDriver($input), ['sqlite3', 'sqlite'])) { $this->addSqliteDatabaseConfig(); } if ($this->config->isServerEnabled($input)) { $this->addNginxConfig(); } return $this; } private function addNginxConfig(): void { $this->content .= str_replace( 'services:', '', $this->config->getConfigFileContents('nginx.yaml') ); $this->content = str_replace( './nginx/conf.d', $this->config->getConfigFilePath('nginx/conf.d'), $this->content ); } private function addSqliteDatabaseConfig(): void { $sqlLiteConfig = $this->config->getConfigFileContents('sqlite.yaml'); $sqlLiteConfig = str_replace('volumes:', '', $sqlLiteConfig); $this->content .= $sqlLiteConfig; } }