# Stablemode · Agent payments — live sandbox demo on Hugging Face Spaces. # Builds the console from the private GitHub fork using a read-only token # stored as the Space secret GITHUB_TOKEN (Settings → Variables and secrets). FROM node:24-bookworm-slim RUN apt-get update \ && apt-get install -y --no-install-recommends postgresql git ca-certificates \ && rm -rf /var/lib/apt/lists/* \ && npm install -g pnpm@10.28.0 ARG REPO=sriram1983007-dev/stablemode ARG BRANCH=feature/agent-to-agent-payments # Bump to the commit being deployed so the clone step is never served from cache. ARG SOURCE_COMMIT=fde96a07aae03c7e0bf595a96a1946236101f470 WORKDIR /app RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \ echo "deploying ${SOURCE_COMMIT}" && git clone --depth 1 --branch "$BRANCH" \ "https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/${REPO}.git" src \ && rm -rf src/.git WORKDIR /app/src RUN pnpm install --frozen-lockfile \ && pnpm --filter @workspace/api-server run build \ && PORT=7860 BASE_PATH=/ pnpm --filter @workspace/stablemode run build COPY start.sh serve.mjs ambient.mjs /app/ RUN chown -R 1000:1000 /app # Spaces run containers as uid 1000; Postgres refuses to run as root anyway. USER 1000 ENV HOME=/tmp NODE_ENV=production EXPOSE 7860 CMD ["bash", "/app/start.sh"]