harb/docs/podman.md
johba 3ab2d9454a health checks (#39)
resolves #35

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: johba <johba@harb.eth>
Reviewed-on: https://codeberg.org/johba/harb/pulls/39
2025-10-02 14:37:59 +02:00

2.3 KiB
Raw Blame History

Podman Staging Environment

The Podman stack mirrors scripts/dev.sh using long-lived containers. Every boot spins up a fresh Base Sepolia fork, redeploys contracts, seeds liquidity, and launches the live-reload services behind Caddy on port 80.

Service Topology

  • anvil Base Sepolia fork with optional mnemonic from onchain/.secret.local
  • bootstrap one-shot job running DeployLocal.sol, seeding liquidity, priming blocks, and writing shared env files
  • ponder npm run dev for the indexer (port 42069 inside the pod)
  • frontend Vite dev server for web-app (port 5173 inside the pod)
  • txn-bot automation loop plus Express status API (port 43069 inside the pod)
  • caddy front door at http://<host>:80, routing /graphql, /health, /rpc/anvil, and /txn to the internal services

All containers mount the repository so code edits hot-reload exactly as the local script. Named volumes keep node_modules caches between restarts.

Prerequisites

  • Podman 4.x (rootless recommended)
  • podman-compose

Launching

podman-compose -f podman-compose.yml build
podman-compose -f podman-compose.yml up
  • First run takes several minutes while Foundry installs deps, deploys contracts, and runs the seeding transactions.
  • Use podman-compose down to stop. Bring-up always redeploys and rewrites services/ponder/.env.local plus tmp/podman/txnBot.env.

Access Points (via Caddy)

  • Frontend: http://<host>/
  • GraphQL: http://<host>/graphql
  • RPC passthrough: http://<host>/rpc/anvil
  • Txn bot status: http://<host>/txn/status

Configuration Knobs

Set environment variables before podman-compose up:

  • FORK_URL Anvil upstream RPC (defaults to https://sepolia.base.org)
  • DEPLOYER_PK, DEPLOYER_ADDR override deployer wallet; otherwise derived from .secret.local or Foundry defaults
  • TXNBOT_PRIVATE_KEY, TXNBOT_ADDRESS, TXNBOT_FUND_VALUE customise bot signer and funding

Edit containers/Caddyfile if you need different routes or ports.

Known Limitations

  • State is ephemeral; every restart wipes the fork and redeploys contracts.
  • Processes run in dev/watch mode (npm run dev), so staging traffic is not production hardened.
  • Secrets live in env files inside the repo mount because no external secret store is wired in.