-
Notifications
You must be signed in to change notification settings - Fork 298
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
55 lines (47 loc) · 1.34 KB
/
docker-entrypoint.sh
File metadata and controls
55 lines (47 loc) · 1.34 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
#!/bin/bash
set -e
echo "🚀 Starting OpenAgents Network..."
# Function to handle shutdown gracefully
cleanup() {
echo "🛑 Shutting down services..."
kill $NETWORK_PID 2>/dev/null || true
wait $NETWORK_PID 2>/dev/null || true
echo "✅ Services stopped"
exit 0
}
# Set up signal handlers
trap cleanup SIGTERM SIGINT
# Start the OpenAgents Network
echo "🌐 Starting OpenAgents Network on port 8700..."
echo " - Studio will be available at /studio"
echo " - MCP will be available at /mcp"
echo " - gRPC transport on port 8600"
openagents network start /network &
NETWORK_PID=$!
# Wait for network to be ready
echo "⏳ Waiting for network to be ready..."
for i in {1..30}; do
if curl -s http://localhost:8700/api/health > /dev/null 2>&1; then
echo "✅ Network is ready!"
break
fi
if [ $i -eq 30 ]; then
echo "❌ Network failed to start within 30 seconds"
exit 1
fi
sleep 1
done
echo ""
echo "✅ OpenAgents is running!"
echo ""
echo "📍 Access points:"
echo " - Studio Web UI: http://localhost:8700/studio/"
echo " - MCP Protocol: http://localhost:8700/mcp"
echo " - HTTP API: http://localhost:8700/api/"
echo " - gRPC: localhost:8600"
echo ""
echo "Press Ctrl+C to stop"
# Wait for network process
wait $NETWORK_PID
# Exit with status of process
exit $?