aboutsummaryrefslogtreecommitdiff
path: root/scripts/build-prod.ps1
diff options
context:
space:
mode:
authorzwlucas <lucas.fariamo08@gmail.com>2026-05-29 21:24:59 +0000
committerzwlucas <lucas.fariamo08@gmail.com>2026-05-29 21:24:59 +0000
commitbf8b1d0d49703e82cf8162399405984bd0b3fe88 (patch)
treeaf4ed5fb7feae49cb3ebe1c8c3f87831e53b8273 /scripts/build-prod.ps1
parent17b159c563278c3b3b8b3884be37f8d5025ce0c7 (diff)
downloadyaum-bf8b1d0d49703e82cf8162399405984bd0b3fe88.tar.gz
yaum-bf8b1d0d49703e82cf8162399405984bd0b3fe88.zip
feat: implement static file serving and Docker support, update frontend build process
Signed-off-by: zwlucas <lucas.fariamo08@gmail.com>
Diffstat (limited to 'scripts/build-prod.ps1')
-rw-r--r--scripts/build-prod.ps127
1 files changed, 27 insertions, 0 deletions
diff --git a/scripts/build-prod.ps1 b/scripts/build-prod.ps1
new file mode 100644
index 0000000..b4c7107
--- /dev/null
+++ b/scripts/build-prod.ps1
@@ -0,0 +1,27 @@
+#!/usr/bin/env pwsh
+$ErrorActionPreference = "Stop"
+$ROOT = Split-Path -Parent $PSScriptRoot
+
+Write-Host "=== Building YAUM single binary ===" -ForegroundColor Green
+Write-Host ""
+
+Write-Host "1. Building frontend..." -ForegroundColor Yellow
+Set-Location "$ROOT/frontend"
+npm ci
+npm run build
+
+Write-Host ""
+Write-Host "2. Copying frontend build to Go embed directory..." -ForegroundColor Yellow
+Remove-Item -Path "$ROOT/backend/internal/static/build" -Recurse -Force -ErrorAction SilentlyContinue
+Copy-Item -Path "$ROOT/frontend/build" -Destination "$ROOT/backend/internal/static/build" -Recurse -Force
+
+Write-Host ""
+Write-Host "3. Building Go binary..." -ForegroundColor Yellow
+Set-Location "$ROOT/backend"
+go build -o yaum.exe ./cmd/server/
+
+Write-Host ""
+Write-Host "=== Done! Binary at backend\yaum.exe ===" -ForegroundColor Green
+Write-Host ""
+Write-Host "Run with:" -ForegroundColor Cyan
+Write-Host " cd backend && .\yaum.exe" -ForegroundColor White