TheEdict commited on
Commit
845741d
Β·
verified Β·
1 Parent(s): 813528e

Upload Dockerfile with huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -15
Dockerfile CHANGED
@@ -4,7 +4,7 @@ FROM agent0ai/agent-zero:latest
4
 
5
  USER root
6
 
7
- # 1. Install dependencies including python3-pip
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
  curl jq python3-pip \
10
  && rm -rf /var/lib/apt/lists/*
@@ -21,14 +21,14 @@ RUN mkdir -p /app/marimo /app/workspace /app/.omniroute && chmod -R 777 /app
21
  # 4. Copy Marimo notebook
22
  COPY marimo_sandbox.py /app/marimo/marimo_sandbox.py
23
 
24
- # 5. Create startup script
25
  RUN cat > /app/start.sh << 'EOF'
26
  #!/bin/bash
27
  set -e
28
 
29
  echo "πŸš€ Starting Marimo Zero..."
30
 
31
- # Parse API_KEYS_JSON
32
  if [ -n "$API_KEYS_JSON" ]; then
33
  echo "πŸ“ Loading API keys..."
34
  export OPENAI_API_KEY=$(echo $API_KEYS_JSON | jq -r '.openai // empty')
@@ -43,18 +43,30 @@ ACCOUNTS
43
  omniroute start --port 20128 --accounts /app/.omniroute/accounts.json &
44
  sleep 2
45
 
46
- # Start Agent Zero (from base image)
47
- echo "πŸ€– Starting Agent Zero..."
48
- # Agent Zero typically runs via zeroclaw or its own entrypoint
49
- # We need to find and run it
50
- if command -v zeroclaw &> /dev/null; then
51
- zeroclaw gateway --port 80 &
 
 
 
 
 
 
 
 
 
 
52
  sleep 5
53
- elif [ -f /app/entrypoint.sh ]; then
54
- /app/entrypoint.sh &
 
55
  sleep 5
56
  else
57
- echo "Warning: No Agent Zero entrypoint found"
 
58
  fi
59
 
60
  # Start Marimo
@@ -62,7 +74,7 @@ echo "πŸ““ Starting Marimo..."
62
  marimo run /app/marimo/marimo_sandbox.py --host 0.0.0.0 --port 8081 --headless &
63
  sleep 3
64
 
65
- # Start proxy (Agent Zero on 80, Marimo on 8081, all on 7860)
66
  echo "πŸ”€ Starting proxy..."
67
  python3 << 'PROXY'
68
  from fastapi import FastAPI, Request
@@ -105,8 +117,6 @@ if __name__ == "__main__":
105
  PROXY
106
 
107
  echo "βœ… Ready!"
108
- echo " Agent Zero: http://localhost:7860"
109
- echo " Marimo: http://localhost:7860/marimo/"
110
  wait
111
  EOF
112
 
 
4
 
5
  USER root
6
 
7
+ # 1. Install dependencies
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
  curl jq python3-pip \
10
  && rm -rf /var/lib/apt/lists/*
 
21
  # 4. Copy Marimo notebook
22
  COPY marimo_sandbox.py /app/marimo/marimo_sandbox.py
23
 
24
+ # 5. Create startup script that ALSO starts base image services
25
  RUN cat > /app/start.sh << 'EOF'
26
  #!/bin/bash
27
  set -e
28
 
29
  echo "πŸš€ Starting Marimo Zero..."
30
 
31
+ # Parse API keys
32
  if [ -n "$API_KEYS_JSON" ]; then
33
  echo "πŸ“ Loading API keys..."
34
  export OPENAI_API_KEY=$(echo $API_KEYS_JSON | jq -r '.openai // empty')
 
43
  omniroute start --port 20128 --accounts /app/.omniroute/accounts.json &
44
  sleep 2
45
 
46
+ # Start Agent Zero services from base image
47
+ # The base image typically runs a Node.js web UI and Python backend
48
+ echo "πŸ€– Starting Agent Zero services..."
49
+
50
+ # Check for and run the base image entrypoint
51
+ if [ -f /entrypoint.sh ]; then
52
+ echo "Running base entrypoint..."
53
+ /entrypoint.sh &
54
+ sleep 5
55
+ elif [ -f /app/run.py ]; then
56
+ echo "Running run.py..."
57
+ python3 /app/run.py &
58
+ sleep 5
59
+ elif [ -f /app/run_ui.py ]; then
60
+ echo "Running run_ui.py..."
61
+ python3 /app/run_ui.py &
62
  sleep 5
63
+ elif command -v node &> /dev/null && [ -f /app/server.js ]; then
64
+ echo "Running Node.js server..."
65
+ node /app/server.js &
66
  sleep 5
67
  else
68
+ echo "Looking for Agent Zero services..."
69
+ find / -name "run*.py" -o -name "server.js" -o -name "main.py" 2>/dev/null | head -5
70
  fi
71
 
72
  # Start Marimo
 
74
  marimo run /app/marimo/marimo_sandbox.py --host 0.0.0.0 --port 8081 --headless &
75
  sleep 3
76
 
77
+ # Start proxy
78
  echo "πŸ”€ Starting proxy..."
79
  python3 << 'PROXY'
80
  from fastapi import FastAPI, Request
 
117
  PROXY
118
 
119
  echo "βœ… Ready!"
 
 
120
  wait
121
  EOF
122