Running with Docker
Run the full metrd stack locally with Docker Compose.
This page is for people building or running metrd's own services, not for using the product - see Getting Started if that's what you're after. metrd is also in alpha, so this reflects local development and testing, not a production deployment guide.
metrd ships as three services - a Postgres database, the API, and the App - wired together with a single docker-compose.yml at the root of the repo. This is the fastest way to get the full stack running locally.
Requirements
- Docker and Docker Compose
- Access to the metrd.io repository(opens in new tab) - it's currently private
Start the stack
git clone https://github.com/ernokieran/metrd.io.git
cd metrd.io
docker compose up -dThis pulls the latest published API and App images, starts Postgres, and wires them together. On first run, the API applies its database migrations automatically against the metrd database.
Once it's up:
- The app is available at http://localhost:3000(opens in new tab)
- The API is reachable through the app's proxy at
http://localhost:3000/api/*
Checking it's healthy
Each service exposes a health endpoint:
curl http://localhost:3000/app/health
curl http://localhost:3000/api/healthBoth should return a Healthy status. You can also check container health directly:
docker compose psConfiguration
The compose file reads a few environment variables, all optional for local use:
| Variable | Default | Description |
|---|---|---|
API_IMAGE | ghcr.io/ernokieran/metrd.io-api:latest | API image to run |
APP_IMAGE | ghcr.io/ernokieran/metrd.io-app:latest | App image to run |
ENCRYPTION_KEY | a non-production placeholder | Key used to encrypt stored integration credentials |
Set an ENCRYPTION_KEY of your own if you're keeping data around beyond a quick test - the default is only there so the stack runs out of the box.
Stopping
docker compose downAdd -v if you also want to drop the database volume and start clean next time:
docker compose down -vBuilding images locally
If you're working on the API or App and want to test your changes in the full stack rather than in dev mode, build local images and point compose at them:
docker build -t metrd.io-api:local ./API
docker build -t metrd.io-app:local -f App/Dockerfile .
API_IMAGE=metrd.io-api:local APP_IMAGE=metrd.io-app:local docker compose up -d