Добавление ssh-ключа к контейнеру tunnel
This commit is contained in:
@@ -101,6 +101,22 @@ switch ($appEnv) {
|
||||
}
|
||||
"test" {
|
||||
$compose = Join-Path $root "docker-compose.test.yml"
|
||||
docker info --format '{{.ServerVersion}}' *> $null
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host "Docker daemon is not reachable. Start Docker Desktop, wait until it is running, then re-run .\run.ps1" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
$keyFile = Join-Path $root "deploy\tunnel\id_tunnel"
|
||||
if (-not (Test-Path $keyFile -PathType Leaf)) {
|
||||
if (Test-Path $keyFile -PathType Container) {
|
||||
Write-Host "deploy\tunnel\id_tunnel is a DIRECTORY - Docker auto-created it because the key file was missing." -ForegroundColor Red
|
||||
Write-Host "Remove it first: Remove-Item -Recurse -Force deploy\tunnel\id_tunnel" -ForegroundColor Yellow
|
||||
} else {
|
||||
Write-Host "No SSH key at deploy\tunnel\id_tunnel (the tunnel container needs it)." -ForegroundColor Red
|
||||
}
|
||||
Write-Host "Add your VPS-authorized key: Copy-Item `$env:USERPROFILE\.ssh\id_ed25519 deploy\tunnel\id_tunnel" -ForegroundColor Yellow
|
||||
exit 1
|
||||
}
|
||||
Write-Host "Building and starting prod-clone in Docker (app + in-container tunnel)..." -ForegroundColor Green
|
||||
docker compose -f $compose up --build -d
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
|
||||
Reference in New Issue
Block a user