Skip to content

Commit

Permalink
ElasticSearch data location customization added
Browse files Browse the repository at this point in the history
  • Loading branch information
Ph3nol committed Sep 25, 2017
1 parent 62e3217 commit ba93f6c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Application/DockerContainer/ElasticsearchDockerContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Ph3\DockerArch\Application\DockerContainer;

use Ph3\DockerArch\Application\Architect;
use Ph3\DockerArch\Application\Service\CerebroService;
use Ph3\DockerArch\Application\Service\ElasticsearchHeadService;
use Ph3\DockerArch\Domain\DockerContainer\Model\DockerContainer;
Expand Down Expand Up @@ -40,6 +41,7 @@ public function preExecute(): void
public function execute(): void
{
$service = $this->getService();
$project = $service->getProject();

$this->setFrom(sprintf('blacktop/elasticsearch:%s', $service->getOptions()['version']));

Expand All @@ -52,6 +54,17 @@ public function execute(): void
);
}

$project
->addEnv('ELASTIC_SEARCH_DATA_LOCATION', Architect::GLOBAL_ABSOLUTE_TMP_DIRECTORY.'/data/elasticsearch');

// Volumes.
$this
->addVolume([
'local' => '${'.$project->generateEnvKey('ELASTIC_SEARCH_DATA_LOCATION').'}',
'remote' => '/usr/share/elasticsearch/data',
'type' => 'rw',
]);

// Ports.
$this->addEnvPort('ELASTIC_SEARCH', ['from' => '8020', 'to' => '9200']);
}
Expand Down

0 comments on commit ba93f6c

Please sign in to comment.