mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-09 03:29:32 +00:00
use FixedPortGenerator for legacy implementations
This commit is contained in:
@@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Testcontainers\Container;
|
||||
|
||||
use Testcontainers\Utils\PortGenerator\FixedPortGenerator;
|
||||
use Testcontainers\Wait\WaitForExec;
|
||||
|
||||
/**
|
||||
@@ -16,6 +17,7 @@ class MySQLContainer extends Container
|
||||
public function __construct(string $version = 'latest', string $mysqlRootPassword = 'root')
|
||||
{
|
||||
parent::__construct('mysql:' . $version);
|
||||
$this->withPortGenerator(new FixedPortGenerator([3306]));
|
||||
$this->withExposedPorts(3306);
|
||||
$this->withEnvironment('MYSQL_ROOT_PASSWORD', $mysqlRootPassword);
|
||||
$this->withWait(new WaitForExec([
|
||||
|
||||
Reference in New Issue
Block a user