Spaces:
Sleeping
Sleeping
Fix: Use inline entrypoint script (no COPY needed)
Browse files42 unmodified lines43444546474849505152535455565758594 unmodified lines6465666768697042 unmodified linesCOPY marimo_sandbox.py /app/marimo_sandbox.py# 8. Copy Static UI# marimo-zero-ui.html is copied to /app/static/index.html by deploy script# We just need to ensure the static directory existsRUN mkdir -p /app/staticCOPY static/index.html /app/static/index.htmlCOPY nginx.conf /etc/nginx/nginx.conf# 9. Copy Proxy Server (routes all ports through 7860)COPY proxy_server.py /app/proxy_server.py# 10. Copy EntrypointCOPY entrypoint.sh /app/entrypoint.shRUN chmod +x /app/entrypoint.sh# 11. HF Spaces Environment4 unmodified linesENV HOME=/appENV HF_SPACE=true# 12. Expose single port (HF Spaces requirement)EXPOSE 7860HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \42 unmodified lines434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293944 unmodified lines9910010110210310410542 unmodified linesCOPY marimo_sandbox.py /app/marimo_sandbox.py# 8. Copy Static UIRUN mkdir -p /app/staticCOPY static/index.html /app/static/index.htmlCOPY nginx.conf /etc/nginx/nginx.conf# 9. Copy Proxy ServerCOPY proxy_server.py /app/proxy_server.py# 10. Create Entrypoint Script Inline (avoids file copy issues)RUN cat > /app/entrypoint.sh << 'ENTRYPOINT_EOF'#!/bin/bashset -eecho "Starting Marimo Zero for Hugging Face Spaces..."if [ -n "$API_KEYS_JSON" ]; thenecho "Parsing API keys from JSON..."export OPENAI_API_KEY=$(echo $API_KEYS_JSON | jq -r '.openai // empty')export ANTHROPIC_API_KEY=$(echo $API_KEYS_JSON | jq -r '.anthropic // empty')export NVIDIA_API_KEY=$(echo $API_KEYS_JSON | jq -r '.nvidia // empty')export GROQ_API_KEY=$(echo $API_KEYS_JSON | jq -r '.groq // empty')export GOOGLE_API_KEY=$(echo $API_KEYS_JSON | jq -r '.google // empty')echo "API keys loaded from API_KEYS_JSON"elseecho "WARNING: API_KEYS_JSON not set!"fiecho "Starting OmniRoute on port $OMNIROUTE_PORT..."cat > /app/.omniroute/accounts.json << 'ACCOUNTS_EOF'{"accounts": [{"name": "openai", "provider": "openai", "api_key": "${OPENAI_API_KEY:-dummy}", "default": true}]}ACCOUNTS_EOFomniroute start --port $OMNIROUTE_PORT --accounts /app/.omniroute/accounts.json &sleep 3echo "Starting Agent Zero on port 80..."zeroclaw gateway --host 127.0.0.1 --port 80 --config /app/.zeroclaw/config.toml &sleep 5echo "Starting Marimo on port $MARIMO_PORT..."marimo run /app/marimo_sandbox.py --host 127.0.0.1 --port $MARIMO_PORT --headless &sleep 3echo "Starting proxy server on port 7860..."python3 /app/proxy_server.py &sleep 2echo "Marimo Zero Ready!"waitENTRYPOINT_EOFRUN chmod +x /app/entrypoint.sh# 11. HF Spaces Environment4 unmodified linesENV HOME=/appENV HF_SPACE=true# 12. Expose single portEXPOSE 7860HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
Dockerfile+41-6