Pass in api url
This commit is contained in:
parent
447a38f519
commit
12e0d87388
2 changed files with 10 additions and 1 deletions
|
@ -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
|
# Stage 1: Build the Vite React app
|
||||||
FROM node:22-alpine AS builder
|
FROM node:22-alpine AS builder
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,10 @@ REGISTRY="docker.botris.dev"
|
||||||
USERNAME="johnbotris"
|
USERNAME="johnbotris"
|
||||||
IMAGE_NAME="femto-webapp"
|
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
|
# Step 0: Ensure clean working directory
|
||||||
if [[ -n $(git status --porcelain) ]]; then
|
if [[ -n $(git status --porcelain) ]]; then
|
||||||
echo "❌ Uncommitted changes detected. Please commit or stash them before running this script."
|
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
|
# Step 3: Attempt Docker build
|
||||||
echo "🔧 Building Docker image..."
|
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..."
|
echo "❌ Docker build failed. Reverting version bump..."
|
||||||
git checkout -- package.json yarn.lock
|
git checkout -- package.json yarn.lock
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue