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

Start the stack

git clone https://github.com/ernokieran/metrd.io.git
cd metrd.io
docker compose up -d

This 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:

Checking it's healthy

Each service exposes a health endpoint:

curl http://localhost:3000/app/health
curl http://localhost:3000/api/health

Both should return a Healthy status. You can also check container health directly:

docker compose ps

Configuration

The compose file reads a few environment variables, all optional for local use:

VariableDefaultDescription
API_IMAGEghcr.io/ernokieran/metrd.io-api:latestAPI image to run
APP_IMAGEghcr.io/ernokieran/metrd.io-app:latestApp image to run
ENCRYPTION_KEYa non-production placeholderKey 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 down

Add -v if you also want to drop the database volume and start clean next time:

docker compose down -v

Building 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