diff options
| author | zwlucas <lucas.fariamo08@gmail.com> | 2026-05-29 21:24:59 +0000 |
|---|---|---|
| committer | zwlucas <lucas.fariamo08@gmail.com> | 2026-05-29 21:24:59 +0000 |
| commit | bf8b1d0d49703e82cf8162399405984bd0b3fe88 (patch) | |
| tree | af4ed5fb7feae49cb3ebe1c8c3f87831e53b8273 /scripts/build-prod.sh | |
| parent | 17b159c563278c3b3b8b3884be37f8d5025ce0c7 (diff) | |
| download | yaum-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.sh')
| -rw-r--r-- | scripts/build-prod.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/build-prod.sh b/scripts/build-prod.sh new file mode 100644 index 0000000..d356034 --- /dev/null +++ b/scripts/build-prod.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -euo pipefail + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +ROOT="$DIR/.." + +echo "=== Building YAUM single binary ===" + +echo "" +echo "1. Building frontend..." +cd "$ROOT/frontend" +npm ci +npm run build + +echo "" +echo "2. Copying frontend build to Go embed directory..." +rm -rf "$ROOT/backend/internal/static/build" +cp -r "$ROOT/frontend/build" "$ROOT/backend/internal/static/build" + +echo "" +echo "3. Building Go binary..." +cd "$ROOT/backend" +go build -o yaum ./cmd/server/ + +echo "" +echo "=== Done! Binary at backend/yaum ===" +echo "" +echo "Run with:" +echo " cd backend && ./yaum" |