-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·74 lines (62 loc) · 1.79 KB
/
start.sh
File metadata and controls
executable file
·74 lines (62 loc) · 1.79 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
#!/usr/bin/env bash
#
# Ragent - Docker Management Script
#
# Usage:
# ./start.sh start Start Qdrant + interactive CLI (auto-stop on exit) [default]
# ./start.sh build Build the app Docker image
# ./start.sh down Stop and remove all containers
#
set -e
COMPOSE="docker compose"
IMAGE_NAME="ragent"
case "${1:-start}" in
build)
echo ""
echo "=========================================="
echo " Ragent - Building..."
echo "=========================================="
echo ""
# Remove old image (if exists) to avoid dangling images after build
docker image rm $IMAGE_NAME 2>/dev/null && echo "Removed old image '$IMAGE_NAME'." || true
$COMPOSE build app
echo ""
echo "Build complete."
;;
start)
echo ""
echo "=========================================="
echo " Ragent - Starting..."
echo "=========================================="
echo ""
# Start Qdrant in background and wait for healthy
echo "[1/2] Starting Qdrant..."
$COMPOSE up qdrant -d --wait
echo "[2/2] Launching Ragent CLI..."
echo ""
# Run app in interactive mode (foreground)
$COMPOSE run --rm app
# Cleanup when user exits
echo ""
echo "Stopping all containers..."
$COMPOSE stop
echo "Done. All containers stopped."
;;
down)
echo ""
echo "=========================================="
echo " Ragent - Downing..."
echo "=========================================="
echo ""
$COMPOSE down -v
echo "Done. All containers downed."
;;
*)
echo "Usage: ./start.sh {start|build|down}"
echo ""
echo " start Start Qdrant + interactive CLI (auto-stop on exit) [default]"
echo " build Build the app Docker image"
echo " down Remove all containers"
exit 1
;;
esac