Files
PVM/run-docker.ps1
AnthonyS f75baef9f8
All checks were successful
PVM/pipeline/head This commit looks good
Aggiunti nuovi parametri in script run-docker
2025-07-22 12:34:48 +02:00

32 lines
929 B
PowerShell

$branch = git rev-parse --abbrev-ref HEAD
$branch = $branch.Replace('/', '-').ToLower()
$container = ("pvm-" + $branch)
$tag = ($branch + ":latest")
$target = Read-Host ("Quale target vuoi usare? (final-prod)")
if ($target -eq "") {
$target = "final-prod"
}
$services = Read-Host("Quali servizi vuoi usare? (http://host.docker.internal:8080)")
if ($services -eq "") {
$services = "http://host.docker.internal:8080"
}
$azienda = Read-Host("Quale azienda vuoi impostare? (integry)")
if ($azienda -eq "") {
$azienda = "integry"
}
docker stop $container
docker rm $container
docker buildx build --load -t $tag --build-arg SERVICES_BASE_URL=$services --build-arg AZIENDA=$azienda --target=$target .
docker run --name $container -d --restart unless-stopped -P ($tag)
Write-Output ("Eseguito container " + $container + " alla porta:")
docker container inspect $container --format="{{json .NetworkSettings.Ports }}"