Update .gitignore and refactor docker-compose.sh for improved host IP detection
- Added .host-ip to .gitignore to prevent tracking of host IP configurations. - Enhanced docker-compose.sh to prioritize HOST_IP environment variable, fallback to .host-ip file, and finally auto-detect the host IP, improving robustness in various environments. - Updated documentation to reflect changes in Supabase migration paths and removed references to deprecated management-dashboard-web-app directory.
This commit is contained in:
@@ -12,9 +12,16 @@ PROJECT_ROOT="$SCRIPT_DIR"
|
||||
# Change to project root
|
||||
cd "$PROJECT_ROOT" || exit 1
|
||||
|
||||
# Detect host IP
|
||||
HOST_IP=$("$SCRIPT_DIR/scripts/get-host-ip.sh")
|
||||
if [ $? -ne 0 ] || [ -z "$HOST_IP" ] || [ "$HOST_IP" = "127.0.0.1" ]; then
|
||||
# Host IP: use HOST_IP env, then .host-ip file, then auto-detect
|
||||
if [ -z "$HOST_IP" ] || [ "$HOST_IP" = "127.0.0.1" ]; then
|
||||
if [ -f "$PROJECT_ROOT/.host-ip" ]; then
|
||||
HOST_IP=$(cat "$PROJECT_ROOT/.host-ip" | tr -d '\n\r' | awk '{print $1}')
|
||||
fi
|
||||
fi
|
||||
if [ -z "$HOST_IP" ] || [ "$HOST_IP" = "127.0.0.1" ]; then
|
||||
HOST_IP=$("$SCRIPT_DIR/scripts/get-host-ip.sh" 2>/dev/null) || true
|
||||
fi
|
||||
if [ -z "$HOST_IP" ] || [ "$HOST_IP" = "127.0.0.1" ]; then
|
||||
echo "Warning: Could not detect host IP, using localhost" >&2
|
||||
HOST_IP="localhost"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user