From df422afa32c1feb2f73fe4e911e050d606f2283d Mon Sep 17 00:00:00 2001 From: achi Date: Wed, 5 Jun 2024 13:36:58 +1000 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=83=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D1=83?= =?UTF-8?q?=20docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Install-Lers.ps1 | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/Install-Lers.ps1 b/Install-Lers.ps1 index 63037e5..27538ab 100644 --- a/Install-Lers.ps1 +++ b/Install-Lers.ps1 @@ -70,6 +70,39 @@ volumes: "@ +function IsInstalled-Docker { + $output = docker --version + + return $output.StartsWith("Docker version"); +} + +function InstallDocker-Redos { + dnf install docker-ce docker-ce-cli docker-compose-plugin +} + +# +# Скрипт для создания compose.yml файла ЛЭРС +# + + +$osRelease = Get-Content /etc/os-release | ConvertFrom-StringData + +# Проверяем установлен ли Docker + +if (IsInstalled-Docker) { + Write-Host "Docker установлен." +} +else { + if ($osRelease.ID -eq "redos") { + InstallDocker-Redos + } else { + Write-Host "Docker не установлен. Установите Docker для вашей операционной системы $($osRelease.NAME)" + exit 1; + } +} + +# Сохраняем compose файл для нужных опций + $compose = $composeWithoutDb if (($db -eq "pg") -or ($db -eq "postgres") -or ($db -eq "postgresql")) { @@ -88,9 +121,11 @@ else { } # Создаём compose.yml + Out-File -FilePath "$composeDir/compose.yml" -InputObject $compose # Создаём переменные среды + $envVars = @" DB_PASSWORD=StrongDb_Password1 "@