Deployment
HealthGuard supports two deployment methods:
- Docker Compose (recommended): One command to start PostgreSQL, Collector, and Dashboard.
- From Source: For local development or debugging.
Prerequisites
Option 1: Docker Compose (Recommended)
bash
git clone https://github.com/Claud-Lu/healthguard.git
cd healthguard
docker compose up -dOpen http://localhost in your browser and register an account.
Default service ports:
| Service | Port | Notes |
|---|---|---|
| Dashboard | 80 | Web UI |
| Collector | 3100 | Event ingestion API; health check at /health |
| PostgreSQL | 5432 | Data persistence |
Environment Variables
Override defaults via a .env file or Docker Compose environment variables:
| Variable | Description | Recommendation |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | Use a strong password in production |
CORS_ORIGIN | Allowed CORS origin | Set to your real domain; avoid * |
HEALTHGUARD_AGENT_TOKEN | Repair Agent bearer token | Generate a strong random secret |
JWT_SECRET | Session signing secret | Must be changed in production |
Production Checklist
- Change the default database password: The default
docker-compose.ymluseshealthguardfor development convenience. - Enable HTTPS: Use a reverse proxy (Nginx, Traefik, or Caddy) with a valid TLS certificate.
- Restrict CORS: Replace
CORS_ORIGIN=*with your actual Dashboard domain. - Back up PostgreSQL regularly: Use
pg_dumpor volume snapshots.
Option 2: Run from Source
bash
git clone https://github.com/Claud-Lu/healthguard.git
cd healthguard
yarn install
# Start PostgreSQL (skip if you already have one locally)
docker run -d \
-e POSTGRES_USER=healthguard \
-e POSTGRES_PASSWORD=healthguard \
-e POSTGRES_DB=healthguard \
-p 5432:5432 \
postgres:16
# Start all services (Collector + Dashboard + Demo)
yarn dev:localLocal URLs:
| Service | URL |
|---|---|
| Dashboard | http://127.0.0.1:5175 |
| Collector | http://127.0.0.1:3100/health |
| Demo | http://127.0.0.1:5174 |
Upgrade
bash
cd healthguard
git pull
docker compose down
docker compose up -d --buildVerify the Deployment
- Open the Dashboard and register an account.
- Create an H5 or mini-program project and copy the
appKey. - Integrate the SDK in a demo app and trigger an error.
- Return to the Dashboard and confirm the event is aggregated into an Issue.