Download start_dev.ps1 from Rsnarsna/Saas-Base: direct link, hf CLI and curl.
- Browser
- Download file 1.91 kB
-
https://huggingface.co/spaces/Rsnarsna/Saas-Base/resolve/main/start_dev.ps1
- Command line
-
hf download hf://spaces/Rsnarsna/Saas-Base/start_dev.ps1
-
curl -L -o start_dev.ps1 https://huggingface.co/spaces/Rsnarsna/Saas-Base/resolve/main/start_dev.ps1
1.91 kB
| <# | |
| .SYNOPSIS | |
| Starts Docker Desktop, spins up the SaaS application via docker-compose, and launches ngrok. | |
| #> | |
| Write-Host "==========================================" -ForegroundColor Cyan | |
| Write-Host " Starting SaaS Local Dev Environment" -ForegroundColor Cyan | |
| Write-Host "==========================================" -ForegroundColor Cyan | |
| # 1. Check if Docker is running | |
| Write-Host "`n[1/3] Checking Docker daemon..." -ForegroundColor Yellow | |
| $dockerInfo = docker info 2>&1 | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Host "Docker is not running. Attempting to start Docker Desktop..." -ForegroundColor Yellow | |
| $dockerPath = "C:\Program Files\Docker\Docker\Docker Desktop.exe" | |
| if (Test-Path $dockerPath) { | |
| Start-Process -FilePath $dockerPath | |
| Write-Host "Waiting for Docker to start (this may take a minute)..." | |
| while ($true) { | |
| Start-Sleep -Seconds 3 | |
| docker info >$null 2>&1 | |
| if ($LASTEXITCODE -eq 0) { | |
| Write-Host "Docker is now running!" -ForegroundColor Green | |
| break | |
| } | |
| Write-Host "." -NoNewline | |
| } | |
| Write-Host "" | |
| } else { | |
| Write-Host "Error: Could not find Docker Desktop at $dockerPath. Please start Docker manually." -ForegroundColor Red | |
| exit 1 | |
| } | |
| } else { | |
| Write-Host "Docker is already running!" -ForegroundColor Green | |
| } | |
| # 2. Start Application via Docker Compose | |
| Write-Host "`n[2/3] Starting Database and Web Application via Docker Compose..." -ForegroundColor Yellow | |
| docker-compose up -d --build | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Host "Failed to start docker containers!" -ForegroundColor Red | |
| exit 1 | |
| } | |
| Write-Host "Containers are up and running!" -ForegroundColor Green | |
| # 3. Start ngrok | |
| Write-Host "`n[3/3] Generating public ngrok URL..." -ForegroundColor Yellow | |
| Write-Host "Starting ngrok on port 8000..." -ForegroundColor Green | |
| ngrok http 8000 | |