created basic .env file and one for local values
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
+15
-10
@@ -12,15 +12,14 @@ fi
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# Load production environment variables
|
||||
if [ -f .env.prd ]; then
|
||||
echo "📝 Loading configuration from .env.prd"
|
||||
export $(grep -v '^#' .env.prd | xargs)
|
||||
else
|
||||
if [ -f .env ]; then
|
||||
echo "📝 Loading configuration from .env"
|
||||
export $(grep -v '^#' .env | xargs)
|
||||
if [ -f .env ]; then
|
||||
echo "📝 Loading configuration from .env"
|
||||
export $(grep -v '^#' .env | xargs)
|
||||
if [ -f .env.local ]; then
|
||||
echo "📝 Loading configuration from .env.local"
|
||||
export $(grep -v '^#' .env.local | xargs)
|
||||
else
|
||||
echo "⚠️ Warning: .env not found, using defaults"
|
||||
echo "⚠️ Warning: .env.local not found, using defaults"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -35,10 +34,16 @@ echo "🔧 Frontend will use API: ${API_URL:-https://bamort-api.trokan.de}"
|
||||
cp ../docker/frontend-entrypoint.sh ../frontend/docker-entrypoint.sh
|
||||
|
||||
# Build only if images for this commit don't exist yet
|
||||
ENV_FILES="--env-file .env"
|
||||
if [ -f .env.local ]; then
|
||||
ENV_FILES="$ENV_FILES --env-file .env.local"
|
||||
echo "📝 Applying overrides from .env.local"
|
||||
fi
|
||||
|
||||
if ! docker image inspect "bamort-backend:${GIT_TAG}" > /dev/null 2>&1 || \
|
||||
! docker image inspect "bamort-frontend:${GIT_TAG}" > /dev/null 2>&1; then
|
||||
echo "🔨 Images not found for tag '${GIT_TAG}', building..."
|
||||
docker-compose -f docker-compose.yml --env-file .env.prd -p bamort build
|
||||
docker-compose -f docker-compose.yml $ENV_FILES -p bamort build
|
||||
else
|
||||
echo "✅ Images already exist for tag '${GIT_TAG}', skipping build."
|
||||
fi
|
||||
@@ -47,7 +52,7 @@ fi
|
||||
docker-compose -f docker-compose.yml -p bamort down
|
||||
|
||||
# Baue und starte die Container
|
||||
docker-compose -f docker-compose.yml --env-file .env.prd -p bamort up -d
|
||||
docker-compose -f docker-compose.yml $ENV_FILES -p bamort up -d
|
||||
|
||||
echo "✅ Production environment started."
|
||||
echo "📱 Frontend: http://localhost:8181"
|
||||
|
||||
Reference in New Issue
Block a user