Files
flutter_ecommerce_portal/install_portal.sh
rbhat 39a4f3283f Initialize project and update portal port configuration
Set default portal port to 8081, fix Dart build issue in cart screen, and update setup documentation.

Co-Authored-By: Oz <oz-agent@warp.dev>
2026-04-10 19:08:30 +05:30

28 lines
729 B
Bash
Executable File

#!/usr/bin/env bash
set -Eeuo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$SCRIPT_DIR"
COMPOSE_FILE="$PROJECT_DIR/docker-compose.yml"
ENV_FILE="$PROJECT_DIR/.env"
if [[ ! -f "$COMPOSE_FILE" ]]; then
echo "docker-compose.yml not found in $PROJECT_DIR"
exit 1
fi
if [[ ! -f "$ENV_FILE" ]]; then
cp "$PROJECT_DIR/.env.example" "$ENV_FILE"
echo "Created $ENV_FILE from .env.example"
echo "Update Firebase variables in .env before first production login test."
fi
docker compose -f "$COMPOSE_FILE" --env-file "$ENV_FILE" up -d --build
PORT="$(grep '^PORTAL_PORT=' "$ENV_FILE" | cut -d= -f2 || true)"
PORT="${PORT:-8081}"
echo
echo "Portal is running at: http://localhost:${PORT}"