forked from open-webui/open-webui
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest-redis-local.sh
More file actions
executable file
·78 lines (71 loc) · 2.13 KB
/
test-redis-local.sh
File metadata and controls
executable file
·78 lines (71 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
# Quick test script for Redis and RQ worker setup
set -e
echo "=========================================="
echo "Open WebUI - Redis & RQ Local Testing"
echo "=========================================="
echo ""
# Check if Redis is running locally
echo "Checking for local Redis..."
if command -v redis-cli &> /dev/null; then
if redis-cli ping &> /dev/null; then
echo "✅ Redis is running locally"
REDIS_HOST="host.docker.internal"
else
echo "⚠️ Redis CLI found but server not responding"
REDIS_HOST="host.docker.internal"
fi
else
echo "⚠️ Redis CLI not found. Will use docker-compose Redis instead."
REDIS_HOST="redis"
fi
# Detect M1 Mac
if [[ $(uname -m) == "arm64" ]] && [[ $(uname) == "Darwin" ]]; then
echo "✅ Detected M1 Mac - will use native ARM64 build"
COMPOSE_FILE="docker-compose.local.m1.yaml"
else
COMPOSE_FILE="docker-compose.local.yaml"
fi
echo ""
echo "Choose an option:"
echo "1. Use Docker Compose (includes Redis container)"
echo "2. Use Docker Run with local Redis (brew install redis)"
echo "3. Use Docker Run without Redis (BackgroundTasks fallback)"
echo ""
read -p "Enter choice [1-3]: " choice
case $choice in
1)
echo ""
echo "Building image..."
docker build -t test_a3 .
echo ""
echo "Starting with Docker Compose..."
docker-compose -f $COMPOSE_FILE up
;;
2)
echo ""
echo "Building image..."
docker build -t test_a3 .
echo ""
echo "Starting container with local Redis..."
echo "Make sure Redis is running: redis-server"
docker run -it -p 8080:8080 \
-e REDIS_URL=redis://host.docker.internal:6379/0 \
-e ENABLE_JOB_QUEUE=True \
test_a3
;;
3)
echo ""
echo "Building image..."
docker build -t test_a3 .
echo ""
echo "Starting container without Redis (using BackgroundTasks)..."
docker run -it -p 8080:8080 \
-e ENABLE_JOB_QUEUE=False \
test_a3
;;
*)
echo "Invalid choice"
exit 1
;;
esac