diff --git a/Dockerfile b/Dockerfile index 6bf56db..824020d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,7 @@ +# Assuming your app runs `vite build` +ARG VITE_API_URL +ENV VITE_API_URL=$VITE_API_URL + # Stage 1: Build the Vite React app FROM node:22-alpine AS builder diff --git a/scripts/bump-build-push.sh b/scripts/bump-build-push.sh index a4dc8a1..529376f 100755 --- a/scripts/bump-build-push.sh +++ b/scripts/bump-build-push.sh @@ -7,6 +7,10 @@ REGISTRY="docker.botris.dev" USERNAME="johnbotris" IMAGE_NAME="femto-webapp" +# Add this before the docker build line +export VITE_API_URL="https://femto-api.botris.social" + + # Step 0: Ensure clean working directory if [[ -n $(git status --porcelain) ]]; then echo "❌ Uncommitted changes detected. Please commit or stash them before running this script." @@ -25,7 +29,8 @@ echo "📦 New version: $NEW_VERSION" # Step 3: Attempt Docker build echo "🔧 Building Docker image..." -if ! docker build -t $IMAGE_NAME .; then + +if ! docker build --build-arg VITE_API_URL="$VITE_API_URL" -t $IMAGE_NAME .; then echo "❌ Docker build failed. Reverting version bump..." git checkout -- package.json yarn.lock exit 1