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:
| 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 credentials. At least 32 characters, with no spaces |
EMAIL_VERIFY_DELIVERABILITY | true | Whether to check that an email's domain can receive mail before creating an account or invite. The check asks Google Public DNS, so set false if the server has no internet access |
EXTERNAL_API_LOGGING_CAPTURE_PAYLOADS | true | Whether to store request and response bodies for Debug API calls |
EXTERNAL_API_LOGGING_MAX_BODY_BYTES | 65536 | Largest body stored per call |
EXTERNAL_API_LOGGING_RETENTION_DAYS | 7 | Days to keep call logs. 0 keeps them forever |
Health checks
curl http://localhost:3000/app/health
curl http://localhost:3000/api/health
docker compose psBuilding 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