From 3b1f58bda80ef28e4b3a1a05fb4b0d2688d30967 Mon Sep 17 00:00:00 2001 From: Rias Date: Mon, 22 Apr 2024 15:08:17 +0200 Subject: [PATCH] Add Timescale --- app/Services/Timescale.php | 49 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 app/Services/Timescale.php 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); + } +}