From a804911606f66fa8b91ffde04f071c1cdc4d6d01 Mon Sep 17 00:00:00 2001 From: Viktor Fomin Date: Mon, 24 Jul 2023 17:24:43 +0300 Subject: [PATCH] Build: Dev: Added custom proxy image build to build.backend.docker.ps1 --- build/build.backend.docker.ps1 | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/build/build.backend.docker.ps1 b/build/build.backend.docker.ps1 index 56b6a9a9cc..a3c834d21e 100644 --- a/build/build.backend.docker.ps1 +++ b/build/build.backend.docker.ps1 @@ -15,6 +15,7 @@ $Login = ($LocalIp + ":5011") $Client = ($LocalIp + ":5001") $Management = ($LocalIp + ":5015") $PortalUrl = ("http://" + $LocalIp + ":8092") +$ProxyVersion="v1.0.0" # Stop all backend services" @@ -36,13 +37,26 @@ if ($args[0] -eq "--community" ) { $Env:INSTALLATION_TYPE = "COMMUNITY" } -Set-Location -Path $DockerDir +Set-Location -Path $RootDir + +if ($args[0] -eq "--build_proxy") { + $ProxyVersion="v9.9.9" + + $Exists= docker images --format "{{.Repository}}:{{.Tag}}" | findstr "onlyoffice/4testing-docspace-proxy-runtime:$ProxyVersion" + + if (!$Exists) { + Write-Host "Build proxy base image from source (apply new nginx config)" -ForegroundColor Green + docker build -t "onlyoffice/4testing-docspace-proxy-runtime:$ProxyVersion" -f "$DockerDir\Dockerfile.runtime" --target proxy . + } else { + Write-Host "SKIP build proxy base image (already exists)" -ForegroundColor Green + } +} Write-Host "Run migration and services" -ForegroundColor Green $Env:ENV_EXTENSION="dev" $Env:Baseimage_Dotnet_Run="onlyoffice/4testing-docspace-dotnet-runtime:v1.0.0" $Env:Baseimage_Nodejs_Run="onlyoffice/4testing-docspace-nodejs-runtime:v1.0.0" -$Env:Baseimage_Proxy_Run="onlyoffice/4testing-docspace-proxy-runtime:v1.0.0" +$Env:Baseimage_Proxy_Run="onlyoffice/4testing-docspace-proxy-runtime:$ProxyVersion" $Env:SERVICE_DOCEDITOR=$Doceditor $Env:SERVICE_LOGIN=$Login $Env:SERVICE_CLIENT=$Client @@ -52,7 +66,7 @@ $Env:BUILD_PATH="/var/www" $Env:SRC_PATH="$RootDir\publish\services" $Env:DATA_DIR="$RootDir\Data" $Env:APP_URL_PORTAL=$PortalUrl -docker compose -f docspace.profiles.yml -f docspace.overcome.yml --profile migration-runner --profile backend-local up -d +docker compose -f "$DockerDir\docspace.profiles.yml" -f "$DockerDir\docspace.overcome.yml" --profile migration-runner --profile backend-local up -d Write-Host "== Build params ==" -ForegroundColor Green Write-Host "APP_URL_PORTAL: $PortalUrl" -ForegroundColor Blue