Fix critical MySQL container removal bug, add named volume for MySQL container, add missing PDO extensions
This commit is contained in:
parent
70d91a346b
commit
bed48bf026
5 changed files with 18 additions and 8 deletions
|
@ -9,4 +9,8 @@ services:
|
|||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${ROOT_PASSWORD}
|
||||
volumes:
|
||||
- ./data/${PROJECT_NAME}/mysql:/var/lib/mysql:cached
|
||||
- mysql_data:/var/lib/mysql:cached
|
||||
container_name: ${PROJECT_NAME}-mysql
|
||||
|
||||
volumes:
|
||||
mysql_data:
|
1
config/php-fpm/MySQL.Dockerfile
Normal file
1
config/php-fpm/MySQL.Dockerfile
Normal file
|
@ -0,0 +1 @@
|
|||
RUN docker-php-ext-install mysqli pdo pdo_mysql > /dev/null 2>&1
|
|
@ -25,6 +25,9 @@ class DockerComposeFileBuilder extends AbstractFileBuilder
|
|||
{
|
||||
$this->content = $this->config->getConfigFileContents('php.yaml');
|
||||
|
||||
if ($this->config->isServerEnabled($input)) {
|
||||
$this->addNginxConfig();
|
||||
}
|
||||
if ($this->config->isDatabaseEnabled($input)) {
|
||||
$databaseDriver = strtolower($this->config->getDatabaseDriver($input));
|
||||
|
||||
|
@ -37,10 +40,6 @@ class DockerComposeFileBuilder extends AbstractFileBuilder
|
|||
}
|
||||
}
|
||||
|
||||
if ($this->config->isServerEnabled($input)) {
|
||||
$this->addNginxConfig();
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,13 +36,18 @@ class PHPDockerFileBuilder extends AbstractFileBuilder
|
|||
$this->addNewLine();
|
||||
$this->content .= $this->config->getConfigFileContents('php-fpm/Sqlite.Dockerfile');
|
||||
}
|
||||
|
||||
if ($this->config->getDatabaseDriver($input) ==='mysql') {
|
||||
$this->addNewLine();
|
||||
$this->content .= $this->config->getConfigFileContents('php-fpm/MySQL.Dockerfile');
|
||||
}
|
||||
}
|
||||
|
||||
$this->content = str_replace('${NODE_VERSION}', (string) $this->config->getNodeVersion($input), $this->content);
|
||||
|
||||
if ($this->config->isXdebugEnabled($input)) {
|
||||
$this->addNewLine();
|
||||
$this->content .= $this->config->getConfigFileContents('php-fpm/Xdebug.Dockerfile');
|
||||
$this->content .= $this->config->getConfigFileContents('php-fpm/XDebug.Dockerfile');
|
||||
file_put_contents(
|
||||
$this->config->getDataDirectory() . '/php-fpm/xdebug.ini',
|
||||
$this->config->getConfigFileContents('php-fpm/xdebug.ini')
|
||||
|
|
|
@ -29,7 +29,8 @@ class DestroyCommand extends AbstractSpinnerCommand
|
|||
return Command::FAILURE;
|
||||
}
|
||||
|
||||
$this->config = new Config($input->getArgument('name'));
|
||||
$projectName = $input->getArgument('name');
|
||||
$this->config = new Config($projectName);
|
||||
|
||||
if (!file_exists($this->config->getDataDirectory())) {
|
||||
$this->style->error('No project found with the provided name.');
|
||||
|
@ -38,7 +39,7 @@ class DestroyCommand extends AbstractSpinnerCommand
|
|||
}
|
||||
|
||||
try {
|
||||
passthru($this->buildDockerComposeCommand('down', false, false));
|
||||
passthru($this->buildDockerComposeCommand('down -v', false, false));
|
||||
recursive_rmdir($this->config->getDataDirectory());
|
||||
} catch (\Exception $exception) {
|
||||
$this->style->error('An error occurred while destroying the project: ' . $exception->getMessage());
|
||||
|
|
Loading…
Add table
Reference in a new issue