Spaces:
Sleeping
Sleeping
Upload Dockerfile with huggingface_hub
Browse files123456725 unmodified lines3334353637384 unmodified lines4344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001019 unmodified lines111112113114115116117118119120121122123# Marimo Zero - Agent Zero + Marimo + OmniRoute# Simplified: Just run Agent Zero's web server directlyFROM agent0ai/agent-zero:latestUSER root25 unmodified linesif [ -n "$API_KEYS_JSON" ]; thenecho "π Loading API keys..."export OPENAI_API_KEY=$(echo $API_KEYS_JSON | jq -r '.openai // empty')fi# Start OmniRoute4 unmodified linesomniroute start --port 20128 --accounts /app/.omniroute/accounts.json &sleep 2# Start Marimoecho "π Starting Marimo..."marimo run /app/marimo/marimo_sandbox.py --host 0.0.0.0 --port 8081 --headless &sleep 3# Start proxy - directly serve Agent Zero static files or proxyecho "π Starting proxy..."python3 << 'PROXY'from fastapi import FastAPI, Requestfrom fastapi.responses import StreamingResponse, HTMLResponsefrom fastapi.staticfiles import StaticFilesimport httpximport osapp = FastAPI()client = httpx.AsyncClient(timeout=120.0)# Try to find and mount Agent Zero web UIAGENT_ZERO_WEB_PATHS = ["/opt/venv-a0/lib/python3.12/site-packages/agent_zero/web","/app/web","/usr/share/agent-zero/web","/var/www/agent-zero",]web_path = Nonefor path in AGENT_ZERO_WEB_PATHS:if os.path.exists(path):web_path = pathbreakif web_path:print(f"Serving Agent Zero web UI from: {web_path}")app.mount("/", StaticFiles(directory=web_path, html=True), name="agent_zero")else:print("Agent Zero web UI not found, serving simple page")@app.get("/")async def root():return HTMLResponse("""<html><head><title>Marimo Zero</title></head><body><h1>π¦ Marimo Zero</h1><p>Agent Zero web UI not found in base image.</p><p><a href="/marimo/">Open Marimo Sandbox</a></p></body></html>""")@app.get("/health")async def health():return {"status": "healthy", "web_path": web_path}@app.get("/marimo")async def marimo_redir():9 unmodified linesr = await client.request(request.method, url, headers=h, content=b)return StreamingResponse(r.aiter_bytes(), status_code=r.status_code, headers=dict(r.headers))if __name__ == "__main__":import uvicornuvicorn.run(app, host="0.0.0.0", port=7860)PROXYecho "β Ready!"echo " Main: http://localhost:7860"echo " Marimo: http://localhost:7860/marimo/"waitEOF123456725 unmodified lines333435363738394 unmodified lines44454647484950515253545556575859606162636465666768697071729 unmodified lines828384858687888990919293949596979899100101102103# Marimo Zero - Official Agent Zero + Marimo + OmniRoute# Uses frdel/agent-zero-exe base imageFROM frdel/agent-zero-exe:latestUSER root25 unmodified linesif [ -n "$API_KEYS_JSON" ]; thenecho "π Loading API keys..."export OPENAI_API_KEY=$(echo $API_KEYS_JSON | jq -r '.openai // empty')export ANTHROPIC_API_KEY=$(echo $API_KEYS_JSON | jq -r '.anthropic // empty')fi# Start OmniRoute4 unmodified linesomniroute start --port 20128 --accounts /app/.omniroute/accounts.json &sleep 2# Start Agent Zero Web UIecho "π€ Starting Agent Zero Web UI..."cd /app && python3 run_ui.py &sleep 5# Start Marimoecho "π Starting Marimo..."marimo run /app/marimo/marimo_sandbox.py --host 0.0.0.0 --port 8081 --headless &sleep 3# Start proxyecho "π Starting proxy..."python3 << 'PROXY'from fastapi import FastAPI, Requestfrom fastapi.responses import StreamingResponseimport httpxapp = FastAPI()client = httpx.AsyncClient(timeout=120.0)@app.get("/health")async def health():return {"status": "healthy"}@app.get("/marimo")async def marimo_redir():9 unmodified linesr = await client.request(request.method, url, headers=h, content=b)return StreamingResponse(r.aiter_bytes(), status_code=r.status_code, headers=dict(r.headers))@app.api_route("/{path:path}", methods=["GET","POST","PUT","DELETE","PATCH"])async def az_proxy(request: Request, path: str):url = f"http://localhost:80/{path}" if path else "http://localhost:80"h = dict(request.headers)h.pop("host", None)b = await request.body() if request.method in ["POST","PUT","PATCH"] else Noner = await client.request(request.method, url, headers=h, content=b)return StreamingResponse(r.aiter_bytes(), status_code=r.status_code, headers=dict(r.headers))if __name__ == "__main__":import uvicornuvicorn.run(app, host="0.0.0.0", port=7860)PROXYecho "β Ready!"echo " Agent Zero: http://localhost:7860"echo " Marimo: http://localhost:7860/marimo/"waitEOF
Dockerfile+22-42