File size: 1,260 Bytes
857a91b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# MatrixCloud demo — Hugging Face Docker Space
#
# This builds matrix-runtime from source and serves the API + embedded console
# on port 8080 (matches `app_port` in README.md). Drop this file (and README.md)
# into a new HF Space repo, or duplicate the published Space.

# ---- build ----
FROM golang:1.24-bookworm AS build
ARG REF=main
RUN git clone --depth 1 --branch "${REF}" https://github.com/agent-matrix/matrix-runtime /src
WORKDIR /src
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/matrix-runtime ./cmd/matrix-runtime

# ---- runtime ----
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
      ca-certificates curl git nodejs npm python3 python3-pip pipx \
    && rm -rf /var/lib/apt/lists/*
COPY --from=build /out/matrix-runtime /usr/local/bin/matrix-runtime

# HF Spaces give you a writable /tmp; durable data should live in Postgres
# (Neon) — set MATRIXCLOUD_DATABASE_URL as a Space secret. The local data dir is
# only model/MCP scratch, so /tmp is fine and avoids storage-permission issues.
ENV MATRIX_RUNTIME_MODE=cloud-worker \
    MATRIX_RUNTIME_PORT=8080 \
    MATRIX_RUNTIME_DATA_DIR=/tmp/matrixcloud \
    MATRIX_SHELL_ENABLED=false
EXPOSE 8080
ENTRYPOINT ["matrix-runtime"]