Add OpenHands startup script with dual-network support
This commit is contained in:
parent
7e7d95d3dc
commit
862df97341
|
|
@ -0,0 +1,34 @@
|
|||
#!/bin/bash
|
||||
# OpenHands Server Startup Script
|
||||
|
||||
# Load API keys
|
||||
source /home/bam/openhands/.env
|
||||
|
||||
# Remove any existing container
|
||||
docker rm -f openhands-app 2>/dev/null || true
|
||||
|
||||
# Start OpenHands in background first
|
||||
docker run --rm --pull=always -d \
|
||||
-p 3000:3000 \
|
||||
--add-host host.docker.internal:172.17.0.1 \
|
||||
-e SANDBOX_RUNTIME_CONTAINER_IMAGE=docker.openhands.dev/openhands/runtime:latest-nikolaik \
|
||||
-e LOG_ALL_EVENTS=true \
|
||||
-e LLM_MODEL="openai/MiniMax-M2" \
|
||||
-e LLM_API_KEY="${MINIMAX_API_KEY}" \
|
||||
-e LLM_BASE_URL="https://api.minimax.io/v1" \
|
||||
-e RUNTIME_STARTUP_TIMEOUT=120 \
|
||||
-e SANDBOX_TIMEOUT=120 \
|
||||
-e SANDBOX_LOCAL_RUNTIME_URL="http://172.17.0.1" \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v /home/bam/.openhands:/.openhands \
|
||||
--name openhands-app \
|
||||
docker.openhands.dev/openhands/openhands:latest
|
||||
|
||||
# Wait for container to start
|
||||
sleep 2
|
||||
|
||||
# Connect to services-stack network for n8n access
|
||||
docker network connect services-stack_services-network openhands-app 2>/dev/null || true
|
||||
|
||||
# Attach to container logs (let systemd manage the process)
|
||||
exec docker logs -f openhands-app
|
||||
Loading…
Reference in New Issue