diff --git a/app/Services/Timescale.php b/app/Services/Timescale.php new file mode 100644 index 0000000..dce878d --- /dev/null +++ b/app/Services/Timescale.php @@ -0,0 +1,49 @@ + 'volume', + 'prompt' => 'What is the Docker volume name?', + 'default' => 'timescale_data', + ], + [ + 'shortname' => 'root_password', + 'prompt' => 'What will the password for the `postgres` user be?', + 'default' => 'password', + ], + ]; + + protected $dockerRunTemplate = '-p "${:port}":5432 \ + -e POSTGRES_PASSWORD="${:root_password}" \ + -v "${:volume}":/var/lib/postgresql/data \ + "${:organization}"/"${:image_name}":"${:tag}"'; + + protected static $displayName = 'Timescale'; + + public function __construct(Shell $shell, Environment $environment, Docker $docker) + { + parent::__construct($shell, $environment, $docker); + + $this->defaultPrompts = array_map(function ($prompt) { + if ($prompt['shortname'] === 'tag') { + $prompt['default'] = $this->tag; + } + + return $prompt; + }, $this->defaultPrompts); + } +}