This guide verifies the self-hosted Run402 Core path: build the Core Gateway Docker image, run it with local Postgres, PostgREST, and the function worker, then execute the Core conformance scripts against the hosted gateway.
Run402 Core is a single-node self-hosting runtime. This path is meant to prove the supported runtime slice is runnable outside Run402 Cloud; it is not yet a production HA deployment.
- Docker Desktop or Docker Engine with Compose v2.
- Node.js 22 and npm.
- Ports
4020,4300, and55432free on127.0.0.1.
From the repo root:
npm ci
docker compose config --quiet
docker compose down -v
docker compose up -d --build corecore depends on postgres, postgrest, and function-worker, so the command starts the full local Core stack.
npm run core:health
npm run core:smokeExpected result:
core:healthreturns{ "status": "ok", "mode": "core" }.core:smokecreates and inspects a local project.
npm run core:conformanceThis runs the supported end-to-end runtime slice:
- apply plan and commit
- inline Postgres migration
- PostgREST/RLS behavior
- static content serving
- storage uploads, signed reads, immutable URLs, and route/static behavior
- trusted local functions
- durable function runs and single-node schedule triggers with manual trigger proof
- narrow Astro SSR runtime
- portable archive import with restart checks
For restart-persistence coverage on the long-running storage/function/SSR fixtures, run these commands one at a time. Do not parallelize them: each fixture intentionally restarts Core services while it is running.
CORE_CONFORMANCE_RESTART=1 npm run core:storage-routing
CORE_CONFORMANCE_RESTART=1 npm run core:functions
CORE_CONFORMANCE_RESTART=1 npm run core:astro-ssrThese commands restart the Core services during the fixture and verify previously applied state still works afterward.
- Core Gateway:
http://127.0.0.1:4020 - Core health:
http://127.0.0.1:4020/health - PostgREST public URL used by projects:
http://127.0.0.1:4300 - Postgres host port:
127.0.0.1:55432
Show service status:
docker compose psShow logs:
docker compose logs core
docker compose logs function-worker
docker compose logs postgrest
docker compose logs postgresRestart only the Core runtime services:
docker compose restart core function-worker postgrestReset all local Core state:
docker compose down -vOmit -v when you want to keep local Postgres/content/function volumes between runs.
This Docker path does not include Run402 Cloud-only operations: billing, managed abuse controls, Aurora operations, global routing, S3/CloudFront storage, custom domains, backups, monitoring, compliance automation, HA/distributed scheduling, missed-tick replay, or hostile multi-tenant function isolation.
It proves the open-source Core Gateway can host the current supported local runtime slice and pass the same conformance scripts that exercise apply, storage, functions, Astro SSR, and portable archive import.