Spaces:
Paused
Paused
| FROM memgraph/memgraph-mage:latest | |
| USER root | |
| # 1. System Dependencies | |
| RUN apt-get update && \ | |
| DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | |
| curl git make g++ bash jq procps net-tools python3 python3-pip dos2unix ca-certificates gnupg \ | |
| && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ | |
| && apt-get install -y nodejs \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # 2. Python Dependencies (Matching HuggingClaw success) | |
| RUN python3 -m pip install --no-cache-dir --break-system-packages \ | |
| huggingface_hub tomli tomli-w gqlalchemy pymgclient | |
| WORKDIR /app | |
| # 3. Setup permissions for HF spaces user (UID 1000) | |
| RUN mkdir -p /app /home/node/.zeroclaw /home/node/.omniroute /var/log/memgraph /var/lib/memgraph /var/run/memgraph /etc/memgraph && \ | |
| chown -R 1000:1000 /app /home/node /var/log/memgraph /var/lib/memgraph /var/run/memgraph /etc/memgraph && \ | |
| chmod -R 777 /var/log/memgraph /var/lib/memgraph /var/run/memgraph /etc/memgraph | |
| USER 1000 | |
| # 4. Install Node.js dependencies | |
| COPY --chown=1000:1000 package*.json ./ | |
| RUN npm install | |
| # 5. Copy application files | |
| COPY --chown=1000:1000 scripts/ ./scripts/ | |
| COPY --chown=1000:1000 public/ ./public/ | |
| COPY --chown=1000:1000 config/ ./config/ | |
| COPY --chown=1000:1000 README.md ./README.md | |
| COPY --chown=1000:1000 VERSION ./VERSION | |
| # 6. Copy Pi agent and infrastructure | |
| # We use raw directories here, not zips, to avoid build complexity and security flags | |
| COPY --chown=1000:1000 agent-pi/ ./agent-pi/ | |
| COPY --chown=1000:1000 mom-infra/ ./mom-infra/ | |
| # 7. Make scripts executable and fix line endings | |
| RUN dos2unix /app/scripts/*.sh && \ | |
| chmod +x /app/scripts/*.sh | |
| # 8. Build mom-infra | |
| WORKDIR /app/mom-infra | |
| RUN npm install && npm run build | |
| WORKDIR /app | |
| # Set environment | |
| ENV PORT=7860 | |
| ENV GRAPH_VIEWER_PORT=7861 | |
| ENV OMNIROUTE_URL=http://localhost:20128/v1 | |
| ENV HOME=/home/node | |
| ENV NODE_OPTIONS="--max-old-space-size=1024" | |
| ENV MEMGRAPH_MEMORY_LIMIT="4GB" | |
| ENV MEMGRAPH_LICENSE_KEY="" | |
| # Expose ports | |
| EXPOSE 7860 7861 20128 7687 | |
| # Start all services via entrypoint | |
| ENTRYPOINT ["/bin/bash", "/app/scripts/entrypoint.sh"] | |