mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-12 09:29:35 +00:00
initial commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Testcontainer\Container;
|
||||
|
||||
use Testcontainer\Wait\WaitForHttp;
|
||||
|
||||
class OpenSearchContainer extends Container
|
||||
{
|
||||
public function __construct(string $version = 'latest')
|
||||
{
|
||||
parent::__construct('opensearchproject/opensearch:' . $version);
|
||||
$this->withEnvironment('discovery.type', 'single-node');
|
||||
$this->withWait(WaitForHttp::make(9200));
|
||||
}
|
||||
|
||||
public static function make(string $version = 'latest'): self
|
||||
{
|
||||
return new self($version);
|
||||
}
|
||||
|
||||
public function disableSecurityPlugin(): self
|
||||
{
|
||||
$this->withEnvironment('plugins.security.disabled', 'true');
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user