Running with Docker

Configure, check, and build the Docker stack.

For installing and updating metrd, see Installation. This page covers the details behind it.

The stack is a Postgres database, the API, and the App, defined in docker-compose.yml at the root of the repo. The API applies its database migrations on startup, and is reached through the App's proxy at http://localhost:3000/api/*.

Configuration

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 credentials. At least 32 characters, with no spaces
EXTERNAL_API_LOGGING_CAPTURE_PAYLOADStrueWhether to store request and response bodies for Debug API calls
EXTERNAL_API_LOGGING_MAX_BODY_BYTES65536Largest body stored per call
EXTERNAL_API_LOGGING_RETENTION_DAYS7Days to keep call logs. 0 keeps them forever

Health checks

curl http://localhost:3000/app/health
curl http://localhost:3000/api/health
docker compose ps

Building images locally

To test 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