<# .SYNOPSIS Deploys the Douyin_TikTok_Download_API to a local Docker image or pushes to a remote registry. .DESCRIPTION This script builds the Docker image and optionally pushes it to a registry or saves it as a tar file for manual transfer. .PARAMETER Push If specified, pushes the image to the registry defined in $Registry. .PARAMETER Save If specified, saves the image to a .tar file for manual transfer. .EXAMPLE .\deploy.ps1 -Save Builds the image and saves it to douyin_tiktok_download_api.tar .EXAMPLE .\deploy.ps1 -Push Builds the image and pushes it to your private registry. #> param ( [Switch]$Push, [Switch]$Save ) $ImageName = "kv-tiktok-download" # Update this with your actual registry if you use one $Registry = "git.khoavo.myds.me/vndangkhoa" $Tag = "v1" Write-Host "Building Docker image..." -ForegroundColor Cyan docker build -t ${Registry}/${ImageName}:${Tag} . if ($LASTEXITCODE -ne 0) { Write-Error "Build failed!" exit 1 } Write-Host "Build successful!" -ForegroundColor Green if ($Save) { Write-Host "Saving image to ${ImageName}.tar..." -ForegroundColor Cyan docker save -o ${ImageName}.tar ${Registry}/${ImageName}:${Tag} Write-Host "Image saved to ${PWD}\${ImageName}.tar" -ForegroundColor Green Write-Host "You can now upload this file to your Synology NAS and load it via Docker." } if ($Push) { $RemoteImage = "${Registry}/${ImageName}:${Tag}" Write-Host "Pushing image to ${RemoteImage}..." -ForegroundColor Cyan docker push ${RemoteImage} if ($LASTEXITCODE -ne 0) { Write-Error "Push failed! Make sure you are logged in to the registry." exit 1 } Write-Host "Push successful!" -ForegroundColor Green } if (-not $Push -and -not $Save) { Write-Host "Build complete. Use -Save to create a transferable file or -Push to push to a registry." -ForegroundColor Yellow }