Prerequisites
- Docker Engine 20.10 or later
- Docker Compose v2 (
docker composecommand, notdocker-compose) - A running PostgreSQL instance (version 16 recommended) accessible from the containers
- Git
Services
Thedocker-compose.yml file defines the following services:
| Service | Image | Port | Description |
|---|---|---|---|
nats | nats | 4222, 6222, 8222 | Message broker for inter-service communication |
redis | redis:6.2-alpine | 6379 | Cache layer used by api-gateway and issuance |
seed | ghcr.io/credebl/seed:latest | — | Runs Prisma migrations and seeds master data |
api-gateway | ghcr.io/credebl/api-gateway:latest | 5000 | HTTP entry point; exposes Swagger UI |
user | ghcr.io/credebl/user:latest | — | User registration, authentication, and profile management |
utility | ghcr.io/credebl/utility:latest | — | Shared utilities required by connection and other services |
connection | ghcr.io/credebl/connection:latest | — | DIDComm connection management |
issuance | ghcr.io/credebl/issuance:latest | — | Verifiable credential issuance |
ledger | ghcr.io/credebl/ledger:latest | — | Ledger interaction and DID registration |
organization | ghcr.io/credebl/organization:latest | — | Organization and wallet management |
verification | ghcr.io/credebl/verification:latest | — | Credential proof verification |
agent-provisioning | ghcr.io/credebl/agent-provisioning:latest | — | Spins up per-organization Credo (AFJ) agent containers |
agent-service | ghcr.io/credebl/agent-service:latest | — | Communicates with running agent containers |
cloud-wallet | ghcr.io/credebl/cloud-wallet:latest | — | Cloud wallet service |
geolocation | ghcr.io/credebl/geolocation:latest | — | Geolocation data service |
notification | ghcr.io/credebl/notification:latest | — | Email and push notification dispatch |
webhook | ghcr.io/credebl/webhook:latest | — | Outbound webhook delivery |
schema-file-server | ghcr.io/credebl/schema-file-server:latest | — | Serves schema files for Polygon/W3C credentials |
Service startup order
Thedepends_on declarations in docker-compose.yml define the following boot sequence:
agent-service additionally waits for agent-provisioning to log "Agent-Provisioning-Service Microservice is listening to NATS" before it starts.
Deployment
Start infrastructure services
Bring up NATS and Redis before the application services:Verify they are healthy:
Run the seed service
The The container exits on completion. Check for errors before proceeding:The seed service mounts
seed service applies Prisma migrations and loads master data (org roles, agent types, ledger configs, platform config):./libs/prisma-service/prisma/data/credebl-master-table.json into the container. Ensure this file is present in your checkout.Create the agent.env file
The Add the values your agent containers require, for example:
agent-provisioning service mounts ./agent.env into the container at /app/agent.env. This file is passed to each spawned agent container. Create it with at minimum the wallet storage credentials:agent.env
Verify services are running
running status. The seed container will show exited 0 — that is expected.Confirm the API gateway is accepting requests:200 or 301 response confirms the gateway is up.Port reference
| Port | Service | Protocol | Purpose |
|---|---|---|---|
5000 | api-gateway | HTTP | REST API and Swagger UI |
4222 | nats | TCP | NATS client connections |
6222 | nats | TCP | NATS cluster routing |
8222 | nats | HTTP | NATS monitoring and health |
6379 | redis | TCP | Redis cache |
Volume mounts
Theagent-provisioning service requires the following mounts:
/var/run/docker.sock) is required so agent-provisioning can spin up per-organization agent containers on the host. The agent-service also mounts the Docker socket and uses volumes_from: agent-provisioning to access the shared agent-config and endpoints directories.
Troubleshooting
seed service fails with a database connection error
seed service fails with a database connection error
Confirm
DATABASE_URL in .env points to a reachable PostgreSQL instance. If PostgreSQL is running on the host machine, use the host’s LAN IP rather than localhost or 127.0.0.1, since services run inside Docker containers.api-gateway container exits immediately
api-gateway container exits immediately
Check logs with
docker compose logs api-gateway. Missing or malformed NKEY seed values are a common cause. Ensure all *_NKEY_SEED variables in .env are set.agent-service never starts
agent-service never starts
agent-service waits for the log line "Agent-Provisioning-Service Microservice is listening to NATS" from agent-provisioning. If agent-provisioning fails to connect to NATS, agent-service will wait indefinitely. Run docker compose logs agent-provisioning to diagnose.NATS authentication errors
NATS authentication errors
The
.env.sample sets NATS_AUTH_TYPE=nkey. Each service has its own *_NKEY_SEED variable. Generate unique NKey seeds for each service and set them in .env. The NATS_CREDS_FILE variable is only required when NATS_AUTH_TYPE=creds.agent containers are not being created
agent containers are not being created
Verify that
/var/run/docker.sock is mounted into agent-provisioning and that the user running Docker has permission to access the socket. Also confirm that AGENT_HOST and AFJ_VERSION are set in .env.