Spaces:
Sleeping
Sleeping
Fix: Use inline entrypoint script (no COPY needed)
Browse files- Dockerfile +41 -6
Dockerfile
CHANGED
|
@@ -43,17 +43,52 @@ COPY omniroute-accounts.json /app/.omniroute/accounts.json
|
|
| 43 |
COPY marimo_sandbox.py /app/marimo_sandbox.py
|
| 44 |
|
| 45 |
# 8. Copy Static UI
|
| 46 |
-
# marimo-zero-ui.html is copied to /app/static/index.html by deploy script
|
| 47 |
-
# We just need to ensure the static directory exists
|
| 48 |
RUN mkdir -p /app/static
|
| 49 |
COPY static/index.html /app/static/index.html
|
| 50 |
COPY nginx.conf /etc/nginx/nginx.conf
|
| 51 |
|
| 52 |
-
# 9. Copy Proxy Server
|
| 53 |
COPY proxy_server.py /app/proxy_server.py
|
| 54 |
|
| 55 |
-
# 10.
|
| 56 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
RUN chmod +x /app/entrypoint.sh
|
| 58 |
|
| 59 |
# 11. HF Spaces Environment
|
|
@@ -64,7 +99,7 @@ ENV WORKSPACE=/app/workspace
|
|
| 64 |
ENV HOME=/app
|
| 65 |
ENV HF_SPACE=true
|
| 66 |
|
| 67 |
-
# 12. Expose single port
|
| 68 |
EXPOSE 7860
|
| 69 |
|
| 70 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|
|
|
|
| 43 |
COPY marimo_sandbox.py /app/marimo_sandbox.py
|
| 44 |
|
| 45 |
# 8. Copy Static UI
|
|
|
|
|
|
|
| 46 |
RUN mkdir -p /app/static
|
| 47 |
COPY static/index.html /app/static/index.html
|
| 48 |
COPY nginx.conf /etc/nginx/nginx.conf
|
| 49 |
|
| 50 |
+
# 9. Copy Proxy Server
|
| 51 |
COPY proxy_server.py /app/proxy_server.py
|
| 52 |
|
| 53 |
+
# 10. Create Entrypoint Script Inline (avoids file copy issues)
|
| 54 |
+
RUN cat > /app/entrypoint.sh << 'ENTRYPOINT_EOF'
|
| 55 |
+
#!/bin/bash
|
| 56 |
+
set -e
|
| 57 |
+
echo "Starting Marimo Zero for Hugging Face Spaces..."
|
| 58 |
+
if [ -n "$API_KEYS_JSON" ]; then
|
| 59 |
+
echo "Parsing API keys from JSON..."
|
| 60 |
+
export OPENAI_API_KEY=$(echo $API_KEYS_JSON | jq -r '.openai // empty')
|
| 61 |
+
export ANTHROPIC_API_KEY=$(echo $API_KEYS_JSON | jq -r '.anthropic // empty')
|
| 62 |
+
export NVIDIA_API_KEY=$(echo $API_KEYS_JSON | jq -r '.nvidia // empty')
|
| 63 |
+
export GROQ_API_KEY=$(echo $API_KEYS_JSON | jq -r '.groq // empty')
|
| 64 |
+
export GOOGLE_API_KEY=$(echo $API_KEYS_JSON | jq -r '.google // empty')
|
| 65 |
+
echo "API keys loaded from API_KEYS_JSON"
|
| 66 |
+
else
|
| 67 |
+
echo "WARNING: API_KEYS_JSON not set!"
|
| 68 |
+
fi
|
| 69 |
+
echo "Starting OmniRoute on port $OMNIROUTE_PORT..."
|
| 70 |
+
cat > /app/.omniroute/accounts.json << 'ACCOUNTS_EOF'
|
| 71 |
+
{
|
| 72 |
+
"accounts": [
|
| 73 |
+
{"name": "openai", "provider": "openai", "api_key": "${OPENAI_API_KEY:-dummy}", "default": true}
|
| 74 |
+
]
|
| 75 |
+
}
|
| 76 |
+
ACCOUNTS_EOF
|
| 77 |
+
omniroute start --port $OMNIROUTE_PORT --accounts /app/.omniroute/accounts.json &
|
| 78 |
+
sleep 3
|
| 79 |
+
echo "Starting Agent Zero on port 80..."
|
| 80 |
+
zeroclaw gateway --host 127.0.0.1 --port 80 --config /app/.zeroclaw/config.toml &
|
| 81 |
+
sleep 5
|
| 82 |
+
echo "Starting Marimo on port $MARIMO_PORT..."
|
| 83 |
+
marimo run /app/marimo_sandbox.py --host 127.0.0.1 --port $MARIMO_PORT --headless &
|
| 84 |
+
sleep 3
|
| 85 |
+
echo "Starting proxy server on port 7860..."
|
| 86 |
+
python3 /app/proxy_server.py &
|
| 87 |
+
sleep 2
|
| 88 |
+
echo "Marimo Zero Ready!"
|
| 89 |
+
wait
|
| 90 |
+
ENTRYPOINT_EOF
|
| 91 |
+
|
| 92 |
RUN chmod +x /app/entrypoint.sh
|
| 93 |
|
| 94 |
# 11. HF Spaces Environment
|
|
|
|
| 99 |
ENV HOME=/app
|
| 100 |
ENV HF_SPACE=true
|
| 101 |
|
| 102 |
+
# 12. Expose single port
|
| 103 |
EXPOSE 7860
|
| 104 |
|
| 105 |
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
|