mirror of
https://github.com/stan220/testcontainers-php.git
synced 2026-09-09 02:29:31 +00:00
30 lines
683 B
PHP
30 lines
683 B
PHP
<?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;
|
|
}
|
|
}
|